Skip to content

Why does wrappedGrammarRule and invokeRuleWithTry 10x the runtime in browser? #1731

Answered by bd82
tyleradams asked this question in Q&A
Discussion options

You must be logged in to vote

Hello again @tyleradams

I suspect the benchmark is still not fully precise.
Assuming these JSON.stringify calls are the culprit for the unexpected results the parseAsync--formulaWithBinaryOp would then include the time of the last two console.logs and JSON.stringify calls from inside formulaWithBinaryOp.

Anyhow I am not sure this is the best way to go about profiling the code, as the inspection itself can modify the performance.
Have you considered trying to use the Chrome Dev Tools profiler?

If you do stick to measuring via .now() calls I recommend you save the data to some global variable and
do all the printing and calculations afterwards...

Replies: 5 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@tyleradams
Comment options

Comment options

You must be logged in to vote
1 reply
@tyleradams
Comment options

Comment options

You must be logged in to vote
1 reply
@tyleradams
Comment options

Answer selected by tyleradams
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1728 on December 28, 2021 20:17.