tag:blogger.com,1999:blog-3554166144204741789.post105268775267112250..comments2023-12-31T02:16:32.747-08:00Comments on 1-800-MAGIC: JNI Made SimpleSergey Solyanikhttp://www.blogger.com/profile/03811112928687191837noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-3554166144204741789.post-20419159601047498512008-03-06T02:13:00.000-08:002008-03-06T02:13:00.000-08:00Hi!I'm sorry to leave personal comment to professi...Hi!<BR/><BR/>I'm sorry to leave personal comment to professional post, but I wasn't able to find your personal email.<BR/><BR/>My last name is Solyanik too and I'm currently very interested in history of this surname.<BR/><BR/>If you will be so kind to answer to several questions, please write me a message: alex at draft.com.uaAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-3554166144204741789.post-15632466900261039352008-03-05T02:35:00.000-08:002008-03-05T02:35:00.000-08:00Sergey,the output of this counter _depends_ on the...Sergey,<BR/><BR/>the output of this counter _depends_ on the clock rate of your memory bus.Egor Paskohttps://www.blogger.com/profile/10065165340282326597noreply@blogger.comtag:blogger.com,1999:blog-3554166144204741789.post-78642227166229826432008-03-04T08:09:00.000-08:002008-03-04T08:09:00.000-08:00Egor,The reason I use rdtsc is because it's the si...Egor,<BR/><BR/>The reason I use rdtsc is because it's the simplest way to measure things in CPU clocks which are more universal than time - for example, the output of this counter does not depend on CPU's clock rate.<BR/><BR/>As far as JNI being slow, the benchmark does not show it. 38 vs. 6 does not point to a lot of work being done - perhaps an attempt to marshal an empty arguments list, but not much more than that.Sergey Solyanikhttps://www.blogger.com/profile/03811112928687191837noreply@blogger.comtag:blogger.com,1999:blog-3554166144204741789.post-86775523045990585382008-03-04T04:14:00.000-08:002008-03-04T04:14:00.000-08:00I am sorry, but the whole idea of the post does no...I am sorry, but the whole idea of the post does not make sense.<BR/><BR/>1. JNI transition is slow, a JVM makes a lot of extra work to make a JNI call (interning live references for GC, maintaining Java env, etc), so, you won't get a high-res timer<BR/><BR/>2. benchmarks do not need high-res timers, just run the same stuff many times and divide. Timer overhead will be negligible.Egor Paskohttps://www.blogger.com/profile/10065165340282326597noreply@blogger.comtag:blogger.com,1999:blog-3554166144204741789.post-45572864501230344722008-03-04T03:01:00.000-08:002008-03-04T03:01:00.000-08:00Since you tested it with C++'s vector, you should ...Since you tested it with C++'s vector, you should also provide a test with a slightly more convenient Java container, java.util.Vector for example.Anonymousnoreply@blogger.com