When profiling issue #114243 I found that LanguagesFoldManager.evaluate() is very often called (thousands of calls in
~6kB file) from ParserManagerImpl.parseAST during evaluation of the AST.
The problem is that in each call it several times calls to NbDocument.findLineNumber() which implementation is very slow
(most of the time spent in GapBranchElement.getElementCount() and GapList.size() ).
We will look at it.
Hi, is this still relevant?
I have made some measuring regarding this issue, it seems that the number of NbDocument.findLineNumber() calls is
smaller comparing to the number observed by Marek when he used a build dated to Aug 30. I am not sure why, but it can be
caused by optimizations done in AST's as well as by a smarter feature querying.
The number of calls was proportional to the number of folds. I have tested it using a 190kB js file (having 5264 lines).
When parsing the file, 1180 calls of findLineNumber() were performed. Cumulative time of the calls was cca 32
milliseconds, while the whole parsing time was about 3 seconds.
Performance on an another big js file was similar.
Additional measuring results:
html file, 422kB, 8159 lines
number of NbDocument.findLineNumber() calls: 7054
cumulative time of the calls: cca 500 ms
total parsing time: cca 8200 ms
in the method and the total parsing time is still acceptable => closing this issue.