From: Leo F. <leo...@ne...> - 2012-01-23 14:01:23
|
Hi Tim, That's interesting. I';ve been doing similar (profiling) tests over specs of some size (e.g., Mondex, Tokeneer, Xenon, IEEE float point unit); although I guess they are smaller than iFACTS - apart from Xenon, which is quite large. On the profiling sessions, the worst culprit was "char[]" arrays, mostly from the java_cup lexer. The Object[] and ArrayList[] were about 2-3% each, for what the char[] was 90% (!)... Similarly, on profiling CPU, it was the IO operations on zzRefill within the java_cup scanner that took the largest chunk of the time (27%). Smart scanning (e.g., lookahead) has taken only about 2-3%. I wonder... what was the profilling setup that you used to get to the creation of Object[] ArrayList as the main problem? Although the change you refer to below shouldn't be relatively simple to change, as Petra pointed out. I just want to get the right picture to tackle such performance problem for larger specs. Best, Leo On 5 Jan 2012, at 23:51, Tim Miller wrote: > Hi everyone, > > Anthony Hall and I have been discussing some memory problems that CZT > has when parsing large specifications. Anthony has been trying to > typecheck the iFacts specification, but without much luck due to the > large memory resources. > > We've each been playing around with VisualVM, and Anthony pointed out is > that the two largest memory hogs are Object[] and ArrayList, taking up > around 23% and 10% of the heap respectively. > Most of the object arrays and ArrayLists contain exactly 10 items, and > almost all items in these lists are null. > > After some poking around, I discovered that when ArrayList is created > using the default constructor, it allocates 10 items initially. This > appears to be where the 10 items come from in each case. I suspect this > may also be contributing to some of the memory problems, considering > that CZT has so many empty annotation lists, etc. Creating ArrayLists > with an initial capacity of 0 or 1 (using the constructor ArrayList(int > initialCapacity)) may give us some substantial space savings > > It appears that most ArrayLists are created in the gnast-generated code. > Petra, how difficult would it be to create these lists using this other > constructor? > > Regards, > Tim > > ------------------------------------------------------------------------------ > Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex > infrastructure or vast IT resources to deliver seamless, secure access to > virtual desktops. With this all-in-one solution, easily deploy virtual > desktops for less than the cost of PCs and save 60% on VDI infrastructure > costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox > _______________________________________________ > CZT-Devel mailing list > CZT...@li... > https://lists.sourceforge.net/lists/listinfo/czt-devel |