Perfect your code
With built-in code review tools, GitHub makes it easy to raise the quality bar before you ship. Join the 31 million developers who've merged over 200 million pull requests.
Sign up for free See pricing for teams and enterprisesdeps: introduce experimental `llhttp` HTTP parser #24059
Conversation
This comment has been minimized.
This comment has been minimized.
nodejs-github-bot
added
the
lib / src
label
Nov 3, 2018
indutny
requested a review
from
bnoordhuis
Nov 3, 2018
This comment has been minimized.
This comment has been minimized.
|
cc @nodejs/http |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
It’s not clear which part are written in TypeScript. I did some experiments recently, and I found out that a major bottleneck in our http implementation are C++/JS transitions. May I ask why this was not sent as a major contribution to http_parser? Would you be ok in transfering this to the foundation? |
This comment has been minimized.
This comment has been minimized.
|
I’m sorry, I must have included the link to the “source” of the project:
https://github.com/indutny/llhttp .
Although the API is similar, the projects are very different internally.
I’d be happy to transfer it to foundation, though.
As for the reason for the change - it is maintenance rather than
performance (the performance is about 2x times better, though!)
Additionally, in the future we could potentially make it generate fully
compatible JS output instead of C to remove the call overhead.
…On Sat, Nov 3, 2018 at 11:36 Matteo Collina ***@***.***> wrote:
It’s not clear which part are written in TypeScript. I did some
experiments recently, and I found out that a major bottleneck in our http
implementation are C++/JS transitions.
May I ask why this was not sent as a major contribution to http_parser?
Would you be ok in transfering this to the foundation?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#24059 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAOjw9Pq00eEwn-LiiMEF7wFR-58xeSSks5urbfngaJpZM4YM2cb>
.
|
This comment has been minimized.
This comment has been minimized.
devsnek
approved these changes
Nov 3, 2018
|
I'm so glad this is finally happening |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@indutny I was wondering when will/if you'll PR this ;) |
refack
added
the
http_parser
label
Nov 3, 2018
refack
reviewed
Nov 3, 2018
deps/http_parser/http_parser.gyp Outdated
refack
added
the
notable-change
label
Nov 3, 2018
This comment has been minimized.
This comment has been minimized.
|
|
refack
added
the
build
label
Nov 3, 2018
This comment has been minimized.
This comment has been minimized.
|
Windows compilation errors:
|
This comment has been minimized.
This comment has been minimized.
|
There seems to be some Windows incompatibilities.
|
This comment has been minimized.
This comment has been minimized.
|
@targos hopefully fixed now. |
This comment has been minimized.
This comment has been minimized.
This is no longer relevant. llparse generates very fast C code, and bitcode is no longer required for the builds. |
This comment has been minimized.
This comment has been minimized.
|
I like the direction here and I'm definitely +1... but, I'd prefer to be a bit conservative on the approach with this... rather than removing and replacing the existing |
This comment has been minimized.
This comment has been minimized.
|
@jasnell that would require a lot of |
This comment has been minimized.
This comment has been minimized.
|
While I'd generally prefer not to have to go that route, yes, I think it would be best... if only because of (a) how critical this particular bit of the code is for Node.js and (b) how performance and security sensitive this particular bit of code has always been. |
refack
reviewed
Nov 3, 2018
deps/http_parser/http_parser.gyp Outdated
deps/http_parser/http_parser.gyp Outdated
ry
reviewed
Nov 3, 2018
| , s_res_H | ||
| , s_res_HT | ||
| , s_res_HTT | ||
| , s_res_HTTP |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Alright, pushed the @jasnell PTAL |
indutny
changed the title
deps: replace `http_parser` with `llhttp`
deps: introduce experimental `llhttp` HTTP parser
Nov 4, 2018
This comment has been minimized.
This comment has been minimized.
|
New CI: https://ci.nodejs.org/job/node-test-pull-request/18322/ (testing only http_parser mode) |
refack
reviewed
Nov 4, 2018
deps/llhttp/llhttp.gyp Outdated
This comment has been minimized.
This comment has been minimized.
IIUC |
BridgeAR
added a commit
that referenced
this pull request
Nov 15, 2018
BridgeAR
added a commit
that referenced
this pull request
Nov 15, 2018
BridgeAR
added a commit
that referenced
this pull request
Nov 15, 2018
BridgeAR
added a commit
that referenced
this pull request
Nov 15, 2018
targos
added a commit
that referenced
this pull request
Nov 15, 2018
targos
added a commit
that referenced
this pull request
Nov 15, 2018
targos
added a commit
that referenced
this pull request
Nov 15, 2018
This was referenced Nov 15, 2018
This comment has been minimized.
This comment has been minimized.
|
@indutny How does one opt-in into using it? Or it has to be consumed on a library level, e. g. from Express.js side? |
This comment has been minimized.
This comment has been minimized.
|
@kibertoad it is currently a build-time flag, so you have to compile Node by passing the |
This comment has been minimized.
This comment has been minimized.
zuohuadong
commented
Nov 21, 2018
•
|
love it!! Can I use it by default in the upcoming Node.js 12? |
This comment has been minimized.
This comment has been minimized.
|
PR in progress to make this a runtime flag: #24739 |
This comment has been minimized.
This comment has been minimized.
|
Should this be dont-land-on-v10.x and dont-land-on-v11.x, BTW? |
This comment has been minimized.
This comment has been minimized.
|
+1 |
This comment has been minimized.
This comment has been minimized.
|
@joyeecheung +1 |
This comment has been minimized.
This comment has been minimized.
|
Too late for 11.x. This is already in v11. 2.0 |
This comment has been minimized.
This comment has been minimized.
|
@targos oops, I meant 8.x, somehow my fingers were not controlled by my brain.. |
This comment has been minimized.
This comment has been minimized.
why do node decide to adopt this then? |
This comment has been minimized.
This comment has been minimized.
|
@tuananh this section answers it: https://github.com/indutny/llhttp#why |
This comment has been minimized.
This comment has been minimized.
|
@indutny by adopting llhttp, isn't it gonna be adding more maintenance responsibility as we need to maintain both llparse and llhttp? |
This comment has been minimized.
This comment has been minimized.
|
Good point. Still both libraries are way more maintainable than http_parser in its current form. |
indutny commentedNov 3, 2018
•
edited
llhttp is modern, written in human-readable TypeScript, verifiable, and
is very easy to maintain.
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes