my application's performance statistics

Friday, 11 February 2022 · 2 messages
RS
Rob Stapper11 Feb 2022 16:26 #
Hi Christian, I did some performance statistics on my application and something caught my eye, which I hope you can shed some light on. I found that when running the application the distribution of the life-cycle fases: Parsing, Compiling, Evaluating and Printing, is: Parsing : 95%, Compiling : 4%, Evaluating : 0.4% and Printing : 0.03% . My development-paradigm is maintainability and not as much as performance optimization. So I expect is a lot of code-optimization during parsing and therefore a relatively high amount of time consumed for parsing. This is confirmed by the relatively low amount of time for the Compiling- and Evaluating-time. Code-optimization actually is a strong point of the parser. However I had expected/hoped that this code-optimization only occurs at the first run and that the optimized code is kept for following runs. This does not seem to be the case. First of all: am I correct in my analysis? Secondly, can you give me any advise on improving the parsing-time, not being giving up on my development-paradigm, based on these stats? Some more stats: The info-view gives for the compiling -fase a total of 2124 lines of which: - Inline …… 923 lines - Remove type check …. 710 lines - Simplify FLWOR …. 218 lines - Rewrite … 150 lines - Unroll …. 12 lines - Merge: concat ….. 11 lines - Open database … 3 lines - Swap operant … 1 lines - Simplify catch * …. 4 lines - Thnx in advance for your reply. Rob Stapper Sent from Mail for Windows
-- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus
CG
Christian Grün11 Feb 2022 18:41 #
Hi Rob,
Quoted text · Rob Stapper · 3 lines
I found that when running the application the distribution of the > life-cycle fases: Parsing, Compiling, Evaluating and Printing, is: >
What’s the total execution time?
Quoted text · Rob Stapper · 3 lines
> However I had expected/hoped that this code-optimization only occurs at > the first run and that the optimized code is kept for following runs. >
We may cache compiled expressions in a future version of BaseX.
Quoted text · Rob Stapper · 4 lines
First of all: am I correct in my analysis? Secondly, can you give me any > advise on improving the parsing-time, not being giving up on my > development-paradigm, based on these stats? >
Possibly yes. A general recommendation for complex code is to reduce the inline limit [1]. In some cases, your code will even be faster if you disable the feature completely (by assigning 0). You could also reduce the UNROLLLIMIT. Hope this helps, Christian [1] https://docs.basex.org/wiki/Options#INLINELIMIT

⚡Generated with XQuery