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

20-25% speed increase #2

Merged
merged 1 commit into from
Mar 7, 2016
Merged

20-25% speed increase #2

merged 1 commit into from
Mar 7, 2016

Conversation

davidmarkclements
Copy link
Member

Flamegraph shows the bottleneck as stringify (from JSON.stringify):

screen shot 2016-03-07 at 12 19 02

We can also see the stringify function is not optimized (hence, slow)

By manually creating the initial string, we remove the stringify bottleneck

screen shot 2016-03-07 at 12 26 23

This yields savings of between 20 and 25%

benchPino_10000: 474.112ms
benchPino2_10000: 364.575ms
benchPinoObj_10000: 525.585ms
benchPinoObj2_10000: 413.634ms
benchPino_10000: 452.948ms
benchPino2_10000: 368.059ms
benchPinoObj_10000: 526.269ms
benchPinoObj2_10000: 428.568ms

@mcollina mcollina merged commit c897432 into master Mar 7, 2016
@mcollina mcollina deleted the stringify-opt branch March 7, 2016 12:32
mcollina added a commit that referenced this pull request Mar 20, 2017
Using webpack with pino for serverside builds: #2
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants