Not logged in
Log in now
Create an account
Subscribe to LWN
LWN.net Weekly Edition for May 23, 2013
An "enum" for Python 3
An unexpected perf feature
LWN.net Weekly Edition for May 16, 2013
A look at the PyPy 2.0 release
I'm curious: where did you get this number? I'm pretty sure that if it was true, I would have noticed it by now.
Good opportunity for Java update
Posted Jul 16, 2012 11:01 UTC (Mon) by man_ls (subscriber, #15091)
Posted Jul 16, 2012 16:58 UTC (Mon) by raven667 (subscriber, #5198)
Posted Jul 16, 2012 21:33 UTC (Mon) by man_ls (subscriber, #15091)
This bit of data seems to suggest that things have improved about 4-fold since then. My own results are a bit higher than those on the page (core i5; IcedTea6): 0.035s vs 0.002s for 1M synchronizations, suggesting a cost of about 30ns for each synchronization. Calling a synchronized method is even cheaper, about 20ns. Not too shabby...
My updated code yields:
1M computations: 0.035s
1M synchronized code blocks: 0.004s
1M synchronized method calls: 0.023s
Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds