-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Revamp the tests #132
Comments
I just tried converting the
From more than 5 seconds to under 0.1 seconds, pretty sweet! |
Wow! Cloning now... |
Although it speeds up tests, doesn't having them run through an http server reflect real-world performance? That's how we figured out there was a speed problem with inMemory in the first place. |
Well we are still piping data over a stream to Busboy, the only thing we don't capture is network latency which we didn't before either. The only thing that has changed is that we no longer pipe back all data thru the response chain as JSON. This is how
Now the thing that took the 5 seconds was serializing buffers with a total of 2 429 095 bytes, then parsing that back into a buffer. This will never happen in a real application. |
This is now fixed in multer |
The tests has a few flaws today and I think that we could improve them substantially. The first problem is that they run quite slow, and this should be easy fixable. Currently it starts an http server, sends the request, then multer gets to parse it. Not too bad, but then everything is serialized back to json and sent over http back to the client, this is a pain for large buffers.
I think that a good approach would be to use felixge/node-form-data to generate the body, and then pipe it directly into multer. The validation would then be done in the
next
callback.The text was updated successfully, but these errors were encountered: