Performance of jME in Windows vs. Linux

Is anyone else experiencing dramatic differences in performance between when running their jME-applications in Windows and in Linux? On the same computer, and when running the same code, Linux outperforms Windows by almost a factor of 2x for me. If it had been the other way around, I would not have been (terribly) surprised (because of driver issues and stuff like that), but as it is, I find it a bit bothersome.



Does anyone else have any similar experiences or any general tips on how to speed up my application in Windows? I imagine that the cause of it lies somewhere in LWJGL rather than jME, but still…

Could there be any one specific thing that your implementation is doing that would be particularly slanted towards one OS or the other?  I'm not exactly sure just what that might be, but I think it's going to be hard for anyone to comment on why this might be without knowing more about what your specific application is.



Is there any way to profile the two systems?  Perhaps, as you say, the LWJGL calls are more efficient under Linux, wouldn't you be able to see that in the profiler?  That a significant amount of time was being put into those calls on Windows and less on Linux?



My gut tells me this is not something at the "graphics card" layer because, just as you say, the drivers for Windows tend to outperform Linux when running the same hardware (sometimes dramatically so) and you are seeing the opposite.  So it's likely something more CPU bound, I'm assuming there's some JNI stuff going on somewhere (sorry, haven't looked that deep into how jME or LWJGL work in the plumbing) and maybe that's just significantly faster under Linux - seems like there would less overhead vs. Windows.



Once again, I'm guessing someone far more intelligent and experienced in this than I will have a better answer for you.

marqx said:

I imagine that the cause of it lies somewhere in LWJGL rather than jME Sun nVidia/Ati, Linus Torvalds / Microsoft, but still...


There's not much jME or LWJGL can do here, it's mostly in the hands of Sun (but performance is pretty consistent there across platforms as long as you use the same VM), and especially Ati or nVidia (there's actually pretty big differences in the drivers, usually biased towards Windows though), and for some things linux is just better than Microsoft (certain IO operations for sure).

Oh, and there's one last factor: you. If you use an older VM or drivers on windows, or you have your windows copy loaded with all kinds of crap that slows it down (like virus/spyware and virus/spyware monitoring tools) that could give linux quite an edge. Also if you look at framerates, and you have v-sync on for windows and off for linux that could also explain a thing or two. I'd also not rely on jME

Aha!  The intelligent person showed up!  See, I told you!  :wink:

Thanks for the responses! There's not much I can do about it then it seems… Still, I find it odd that the difference in performance is so extremely large between the two systems. Is anyone aware of how the native LWJGL-binaries supplied with jME are compiled? I notice major performance differences pretty much regardless of what I render. The difference is large enough that it doesn't feel like driver issues or differences between the JVM's. The cynical part of me is therefore leaning towards that the LWJGL-binaries are compiled with a 10-year old GCC with no optimizations turned off. :wink: But I'm probably wrong.

It doesn't really matter how LWJGL is compiled, since practically all it does (related to performance) when you invoke a method is invoke another method (the OpenGL C equivalent), and usually with only a bunch of floats and pointers as parameters. A 10 year old GCC compiler isn't twice as slow as another compiler for that, so because the difference is so large, it seriously doubt it's a problem with the compiler used.



Also, I haven't heard of any other people having the "problem" that linux is twice as fast… maybe you should try to see if the same happens for other crossplatform OpenGL software.

Yeah, I suppose I'll have to investigate it a bit further. It's obviously not a problem that the game runs fast on Linux, but it is unfortunate that the game runs slower on Windows when it's so obvious that the machine itself can run it so much faster. Anyway, thank you for your comments! I will try to investigate a bit and will keep you guys posted if I find something out.

it's a MS conspiracy, purposely hobbling OpenGL programs on windows…  :wink: