Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

difference in client and server results  RSS feed

 
Alex Teslin
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
When i test method inlining with server and client with disabled JIT, i get slightly different results. I manualy optimized the code(calling the value from the same method) and Unoptimized code calling method to call another one for a value. I get these results:
Server: 25100
Client: 24256

If JIT is off in both client and server modes, why they give different results?
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That looks like a very small difference to me. I usually see larger variation than that just from running the exact same code two or three times in a row. What happens if you repeat the experiment several times? How much do the numbers vary? Does server mode ever come out faster than client mode?

In general I agree that it seems both modes should be effectively the same when JIT is disabled (is it the -Xint option you're using?). But there might still be subtle differences beyond the difference in JIT compilers, that weren't considered worth mentioning because normally the JIT differences are much more significant.
 
Alex Teslin
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When i compare server mode to a client mode the difference is very large. It is more than 40 times faster over client mode on both with optimized and non-optimized code. But when I compare only server mode with -Xint option with optimized and non-optimized code, that is when i get this small difference. I do run serveral times and still get that slight difference. I know it is a very small difference but i wanted to know due to what factor that occur?
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24215
37
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think Jim interprets your numbers as milliseconds to do some task -- that's what they look like to me too. But reading your reply, we can't possibly be talking about 0.9 seconds our of 25 when the difference is normally a factor of 40. There's no way that you've got code that runs 40 times faster under the server VM -- the difference is not that large.

So what are these numbers? You mention inline functions, so something to do with call counts? How do you generate these?
 
Alex Teslin
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The simplest code is


SIZE of loop is 100000000

I am timestamping outside those methods for each
 
steve souza
Ranch Hand
Posts: 862
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Although your method names indicate that the methods will be inlined or not , I don't think you can look at the code and tell which it would do. You would have to look at a decompiler to tell if it was at compile time (due to the fact that the method is public I am guessing it isn't, but I am not sure). Even if it isn't inlined at compile time maybe it could be at runtime? These microtunings aren't good to focus on. Any real method would probably not be called that often, and if it was almost for sure the performance hit would be due to the work the method actually did, not simply calling it.

I also changed the code below to show how jamon can be used to keep aggregate stats such as avg time, total time, max time, min time and more...



[/QB]
 
Stefan Wagner
Ranch Hand
Posts: 1923
Linux Postgres Database Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The methods called in the loop return values which are never used and without side-effects.
So they might have been optimized away.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!