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

Atomic async writes #102

Merged
merged 14 commits into from
Aug 27, 2021
Merged

Atomic async writes #102

merged 14 commits into from
Aug 27, 2021

Conversation

mcollina
Copy link
Member

Fixes: #96

@mcollina mcollina requested a review from jsumners August 27, 2021 08:14
@mcollina
Copy link
Member Author

mcollina commented Aug 27, 2021

I resolved most of the preformance regressions introduced for the async and sync case. However it still degrades the performance if minLength is set. I think this is good to land anyway as it improves things for the basic case!

This branch:

benchSonic*1000: 455.379ms 
benchSonicSync*1000: 6.695s
benchSonic4k*1000: 450.397ms                                                                                                                                                                   
benchSonicSync4k*1000: 330.373ms
benchCore*1000: 4.554s
benchConsole*1000: 9.565s
benchSonic*1000: 378.047ms
benchSonicSync*1000: 6.684s
benchSonic4k*1000: 440.553ms
benchSonicSync4k*1000: 325.768ms
benchCore*1000: 4.518s
benchConsole*1000: 9.638s

master:

benchSonic*1000: 486.568ms
benchSonicSync*1000: 6.806s
benchSonic4k*1000: 437.865ms
benchSonicSync4k*1000: 296.988ms
benchCore*1000: 4.506s
benchConsole*1000: 9.595s
benchSonic*1000: 404.316ms
benchSonicSync*1000: 6.756s
benchSonic4k*1000: 419.896ms
benchSonicSync4k*1000: 293.911ms
benchCore*1000: 4.526s
benchConsole*1000: 9.163s

Those were taken on Node.js v16.

index.js Outdated
actualWrite(this)
}
return len < 16384

return len < 163874
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo?

@mcollina mcollina merged commit b1da473 into master Aug 27, 2021
@mcollina mcollina deleted the atomic-async-writes branch August 27, 2021 16:07
@ronag
Copy link
Contributor

ronag commented Sep 30, 2021

@mcollina pino still suffers from this problem since it has sonic-boom v1 as dependency. Could we bump it on pino v6?

@mcollina
Copy link
Member Author

You can use sonic-boom with pino@6, just instantiate one and pass it as a stream.

Unfortunately there are a few semver-major changes in there.

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

Successfully merging this pull request may close these issues.

MAX_WRITE can cause messages to split
2 participants