Pete Whelpton created NETBEANS-2530: ---------------------------------------
Summary: Optimize GrammarParser.java in CSS Lib module Key: NETBEANS-2530 URL: https://issues.apache.org/jira/browse/NETBEANS-2530 Project: NetBeans Issue Type: Improvement Components: web - CSS Editor Affects Versions: 11.0 Reporter: Pete Whelpton Trying to bring the CSS module grammar (the .properties files in the CSS Editor module) up to date causes severe performance issues in NB due to the recursive nature of the parseElements() method of the GrammarParser class. 1) Recursive grammar (such as that of the calc() function in css) will cause a stack overflow as parseElements() will keep calling itself to resolve references until the stack is blown 2) Not using recursive grammar will still cause major performance issues will more than 1/2 levels of references, as memory gets eaten due to the parseElements() method not having a cache (e.g. it will call itself to try and resolve a reference it has already resolved previously, doing a lot of unnecessary work). In its current implementation it can blow the Java heap. I have grammar pretty much ready to go to implement CSS Values and Modules function in NB (e.g. proper implementation of calc(), min(), max(), attr() etc.), and have got 2) to be less of an issue by using a HashMap to cached reference properties so they don't get resolved again. Performance is still "stutery" at best - at NB memory still gets used up, but then reclaimed by the GC. Could really use some help properly optimizing this class. I think this should be fairly straightforward for somebody who knows what they are doing! I'd love to help bring CSS support up to date! -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org For additional commands, e-mail: commits-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists