-
Notifications
You must be signed in to change notification settings - Fork 17.6k
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
net/textproto: the DotReader/DotWriter is extremely slow #56047
Comments
Could you run go pprof and upload the profiling data? thank~ |
|
I optimized these routines here: https://github.com/go-textproto/textproto
But I'm not sure if it's suitable to be submitted to the Golang's stdlib. I used a hack to "rewind" arbitrary bytes read from a I could however write a safer and more optimized version if we use But anyway, this shows that the implementation in the stdlib has a lot of room for performance improvement. |
We encourage developers to send out high-quality CL(PR) for Go, if you find a way to improve the stdlib and it's acceptable, feel free to send a CL, following this tutorial. |
I didn't expect the bottle neck of my program to came from the standard lib, but this seems to be an exception.
The DotReader/DotWriter from the net/textproto library uses bufio.ReadByte/WriteByte on each input/output byte, which is over 300 times slower than bufio.Read/Write functions for the same amount of data. This is causing significant impact on data throughput for applications using these interfaces.
The text was updated successfully, but these errors were encountered: