Skip to content
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

Performance issue when parsing large JSON param #266

Closed
zaker139 opened this issue Sep 18, 2021 · 1 comment
Closed

Performance issue when parsing large JSON param #266

zaker139 opened this issue Sep 18, 2021 · 1 comment
Labels

Comments

@zaker139
Copy link

zaker139 commented Sep 18, 2021

int len = strlen($1);

JSON parsing became quite slow, when request body contains a large size string. Since 'strlen' invokes every char for each.

int len = strlen($1);
$$ = realloc($1, len+strlen($2) + 1);
sprintf($$+len, "%s", $2);

'$1' orginal string may be damn large. eg. When post a large json param size exceed 10M by restconf protocol, then the process was stuck there.

olofhagsand added a commit that referenced this issue Sep 20, 2021
* Fixed: [Performance issue when parsing large JSON param](#266)
* Moved strlen() from for end condition
* Fixed debugging of xpath parser
@olofhagsand
Copy link
Member

Thanks for detecting, please verify

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants