-
Notifications
You must be signed in to change notification settings - Fork 235
Micro-optimisations to perform better on JSON and String processing #1280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
* free_token is general Javascript deallocation, json_free_token creates a special case with reduced evaluation
|
Can you share some before/after performance numbers? I note there are some unrelated changes in your PR. |
|
The performance data is in "Instruments" format |
|
I have cleaned up the mix ups with other pieces of code |
bnoordhuis
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM module some style issues, thanks for the PR!
quickjs.c
Outdated
| if (p >= s->buf_end) { | ||
| goto end_of_input; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if (p >= s->buf_end) { | |
| goto end_of_input; | |
| } | |
| if (p >= s->buf_end) | |
| goto end_of_input; |
quickjs.c
Outdated
| case TOK_NUMBER: | ||
| JS_FreeValue(s->ctx, token->u.num.val); | ||
| break; | ||
| case TOK_STRING: | ||
| JS_FreeValue(s->ctx, token->u.str.str); | ||
| break; | ||
| case TOK_IDENT: | ||
| JS_FreeAtom(s->ctx, token->u.ident.atom); | ||
| break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| case TOK_NUMBER: | |
| JS_FreeValue(s->ctx, token->u.num.val); | |
| break; | |
| case TOK_STRING: | |
| JS_FreeValue(s->ctx, token->u.str.str); | |
| break; | |
| case TOK_IDENT: | |
| JS_FreeAtom(s->ctx, token->u.ident.atom); | |
| break; | |
| case TOK_NUMBER: | |
| JS_FreeValue(s->ctx, token->u.num.val); | |
| break; | |
| case TOK_STRING: | |
| JS_FreeValue(s->ctx, token->u.str.str); | |
| break; | |
| case TOK_IDENT: | |
| JS_FreeAtom(s->ctx, token->u.ident.atom); | |
| break; |
djinn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated according to convention
djinn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected indentation
bnoordhuis
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍


free_tokenis general Javascript deallocation,json_free_tokencreates a special case with reduced evaluation for JSON objects