From: Jimmy Z. <cra...@co...> - 2007-03-19 19:30:54
|
Tatu, Are you aware of any pointers that discusses the behavior for server JVM a bit more... In addition to your suggestion, I also think that the behavior of JVM has to do with file sizes as well... for a large GML, JVM seems to reach steady state (native code) pretty quickly... Jimmy ----- Original Message ----- From: "Tatu Saloranta" <cow...@ya...> To: "Fernando Gonzalez" <fer...@gm...>; <vtd...@li...> Sent: Monday, March 19, 2007 12:19 PM Subject: Re: [Vtd-xml-users] Storing parsing info > > --- Fernando Gonzalez <fer...@gm...> wrote: > >> Well, jeje, the computer is new but I don't think my >> disk is so fast. I >> think Java or the operating system has to cache >> something because the first >> time I load the file it takes a bit more than 2 >> seconds and after the first >> load, it only takes 300ms to read the file... >> I have no experience on doing benchmarks and maybe >> I'm am missing something. >> That's why I attached the program. > > One thing you need to know is that JVM's HotSpot does > incremental optimization. As such, calling anything > first time (or, rather, first N, where N can be like > 2000 times) will take much much longer. This because > code at first will be interpreted from byte code. Only > after JVM notices particular part code is so-called > "hot spot" (called so often it is where most time is > spent) it will inline it to native code. > > Because of this, one must always ensure that there is > enough of so-called warmup time to reach steady state > performance. That is, unless your use case is such > where you only run things once, using separate JVM > instance. > > So it perfectly normal (and expected) that > loading+parsing things first time is significantly > slower than second time around. > If you want to ensure it's not due to OS-level disk > block caching (which also affects results), you can > warm things up using different xml files: code paths > should be same or similar, so HotSpot will optimize > code, but data is different, so OS won't be able to > cache it. > > Hope this helps, > > -+ Tatu +- > > > > > ____________________________________________________________________________________ > Looking for earth-friendly autos? > Browse Top Cars by "Green Rating" at Yahoo! Autos' Green Center. > http://autos.yahoo.com/green_center/ > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Vtd-xml-users mailing list > Vtd...@li... > https://lists.sourceforge.net/lists/listinfo/vtd-xml-users > |