-
Notifications
You must be signed in to change notification settings - Fork 652
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
HTTPHeaders.description is unnecessarily slow #2930
Comments
I've looked at the code base a bit on swift-nio/Sources/NIOHTTP1/HTTPTypes.swift Line 315 in 19da487
Maybe I am not looking at the proper type? |
You are and that's the problem.
or something similar, then it should be much faster. We should discuss the format we want to return here. CC @Lukasa WDYT, format for HTTP headers for |
We can do that, though the resolution of that format is poor: it'll mishandle some things that are otherwise fine. But for a first order approximation that output is ok. |
Expected behavior
HTTPHeaders.description should be reasonably fast and shouldn't do any dynamic
debugPrint(...)
Actual behavior
It's slow. Look at this image: about 15% of the overall runtime of a client hitting
/dynamic/info
is just spent doing header printing...That's largely because of
debugPrint
etc.Printing HTTP headers is somewhat common and shouldn't be unnecessarily fast. The representation could also be nicer.
The text was updated successfully, but these errors were encountered: