-
Notifications
You must be signed in to change notification settings - Fork 213
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
Changes in v1.0.0 #266
Comments
I'm interested to see how it stands up against busboy 1.0 in terms of speed. And if it would be worth implementing busboy into node-fetch. I'm also interested how this stands up against using URLSearchParams to do the hole parsing instead of using any streamable method. |
I'm not sure I understand why an http client is implementing form decoding. Anyway, if the multipart/form-data parser was based on one from an older fork of
That's what |
|
Another thing to keep in mind is that Another distinction is that |
Ah ok, I was unaware that was a thing. That's pretty strange. |
This comment has been minimized.
This comment has been minimized.
Hey @mscdex on what version and how you run these benchmarks? Seems like when run |
@tunnckoCore Version of what? The package versions being benchmarked are already listed. Also I'm not sure what you're referring to with the |
meant to say Nodejs version.
Yep, |
@tunnckoCore Node version is listed before the package versions.
Probably missing a |
Ah, yea. That was it. |
- No more constructor - Truncated flags, encoding, and mime type information have been consolidated into a single object passed to the event handlers See: mscdex/busboy#266
- No more constructor See: mscdex/busboy#266
- No more constructor - Truncated flags, encoding, and mime type information have been consolidated into a single object passed to the event handlers See: mscdex/busboy#266
Per this update, busboy should use on('close') rather than on('finish'). mscdex/busboy#266
* Update busboy sample to use on('close') Per this update, busboy should use on('close') rather than on('finish'). mscdex/busboy#266 * Update busboy version Co-authored-by: Jennifer Davis <iennae@gmail.com> Co-authored-by: Adam Ross <adamross@google.com> Co-authored-by: Karl Weinmeister <11586922+kweinmeister@users.noreply.github.com>
Busboy API changed in 1.0.0 mscdex/busboy#266 and 7265ecb updated busboy and broke uploading to restore settings.
Busboy API changed in 1.0.0 mscdex/busboy#266 and 7265ecb updated busboy and broke uploading to restore settings.
Breaking and Potentially Breaking Changes
'close'
event instead of'finish'
event when you need to executesomething whether the
busboy
stream encountered an error or not'field'
and'file'
event handler parameters have changedinto a single object passed to the event handlers
implementation to using encodings/charsets supported internally by node
(via either core encodings or built-in ICU). If you need to support less
common encodings/charsets, then make sure you are using a build of node that
contains the full ICU database for maximum compatibility.
node's http parser (80KB -> 16KB)
Misc. Changes
transcoding of strings
since the original implementation
streamsearch
improvements)dicer
, usesstreamsearch
directlyBenchmarks
Setup
Node version used: v16.13.1
Package versions used:
busboy
- v0.3.1streamsearch
v1.x perf improvementsvia
dicer
busboy
- v1.0.0formidable
- v2.0.1formidable
has a streaming urlencoded parser, but it is not usedby
formidable
currently when parsing urlencoded forms, however I haveincluded benchmarks for this parser in the urlencoded benchmarks for
completeness
multiparty
- v4.2.2Note: In these benchmarks,
formidable
technically has a bit of an edgecompared to the other modules since the code to benchmark it is using the
individual parsers (multipart and urlencoded) directly, skipping a lot of extra
code that would ordinarily execute while parsing a request. This was done this
way as it was the easiest way to benchmark
formidable
without saving files todisk, which would otherwise put
formidable
at a disadvantage because the othermodules are not saving files to disk.
Note 2:
bench-urlencoded-fields-100pairs-small.js
takes into account extranon-parsing-related logic (e.g. creating new instances and other setup code) so
it's not strictly a measure of parsing performance. The reason for this is that
the benchmark parses the same request multiple times in an async loop, since the
modules parsing an urlencoded request is very quick and may not give V8 time to
optimize functions, etc. and the modules' parser instances generally cannot be
reused.
Results
bench-multipart-fields-100mb-small.js
15077
338
426
145
3600
143
1450
144
bench-multipart-fields-100mb-big.js
1160
270
398
186
3640
187
1510
186
bench-multipart-files-100mb-small.js
433
149
377
145
3700
143
1400
145
bench-multipart-files-100mb-big.js
451
186
398
186
3800
187
1500
186
bench-urlencoded-fields-100pairs-small.js
2700
99
227
41
230
41
260
42
bench-urlencoded-fields-900pairs-small-alt.js
31.0
45
5.7
34
6.2
34
6.7
34
The text was updated successfully, but these errors were encountered: