<p>I'm currently working on a game engine that uses a lot of bitwise operations. Will Golang out perform the JVM because of it's compilation to machine code or is the JVM well optimized enough to perform on the same level as a compiled-to-machine-code language? Does the extra overhead the Scala compiler introduces make a (large enough) difference? </p>
<p>I'd love to hear some thoughts on this.</p>
<p>Thanks</p>
<hr/>**评论:**<br/><br/>drvd: <pre><p>Stop thinking and guessing and start measuring relistic loads. Good luck!</p></pre>mixedCase_: <pre><p>They're about on par. On some workloads Scala will be better than Go and vice versa.</p>
<p>Do note that Go 1.7 is going to improve Go's performance significantly and will probably beat or be equal to JVM languages.</p>
<p>That said, the JVM has received a ridiculously insane amount of engineering work towards optimizing it.</p>
<p>Go 1.0 was released 4 years ago and there are many versions planned before hitting 2.0. Plus, it's a much simpler language. I would be very surprised if a couple or more years from now Go doesn't end up in a whole different ballpark performance-wise.</p></pre>bmurphy1976: <pre><p>I don't know how anybody could possibly answer this question for you. There are so many unknowns and unknowables that the only realistic way is for you to answer the question yourself: build a prototype and see what works best. Also, keep in mind, given that you claim to be building a "game engine", it's quite possible that the answer will be "neither."</p>
<p>Experiment, then analyze, then build.</p></pre>Sythe2o0: <pre><p>One thing you might want to take into account is how much memory management you want to do-- gc pause times will probably be a big concern for keeping frame rate up in your engine. I'd recommend measuring or researching pause time comparisons between Java and Go.</p></pre>zippoxer: <pre><p>Measure it yourself.</p></pre>ibib90: <pre><p>I really have no idea what is faster but i strongly suppose that when you use the <a href="https://golang.org/doc/asm" rel="nofollow">golang asm</a> library that you will outperform java.</p>
<p>But i dont know if its within your constrains.</p></pre>