java - Avoid jvm warmup -


if designing test on sorting algorithm can way avoid jvm warmup ? thank you!

double count = 0; double start, end; for(int r = 0; r < warmup; r++) {     // test } for(int t = 0; t < runs; t++){     start = system.nanotime();     // test     end = system.nanotime();     count += start - end; } double avg = count/avg 

the jvm warmup refers time takes jvm find hotspots , jit these sections of code. if run actual tests few hundred (actually few thousand believe) times should go.

you should know that, if this, there no guarantees. you'll have experiment particular jvm figure out how work have before vital parts jited , on.


in this little case study jit compilation kicked in after 1700 calls.


Comments

Popular posts from this blog

Add email recipient to all new Trac tickets -

400 Bad Request on Apache/PHP AddHandler wrapper -

php - Change action and image src url's with jQuery -