-
Notifications
You must be signed in to change notification settings - Fork 17
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
Add more powerful benchmarks #54
Conversation
@Uzlopak There is definitely something wrong with how our benchmarks are written, I don't think we were actually awaiting anything to finish processing originally and were counting who knows what. Now it seems to be fixed, but for some reason nothing gets returned as a result of the operation. Could you take a look? Wonder if we are using wrong header. You can see it in action by running |
Does this help? |
allowUnsafe does not really generate data :/ |
@Uzlopak Version that is currently pushed returns immediately, promise is not resolved properly for some reason. I'm trying to produce much simpler example based on our usage of Busboy in |
pushed now. If i make some low rounds, like 10 warmup and 10 benchmark cycles it will get results. |
second
second |
Also it seems that the preset command line parameter is not passed to executioner.js |
@Uzlopak Much better now, thank you! Still trying to figure out what can we listen to to ensure that we actually read the expected parts of the payload in expected way; knowing that we fired the finish event is not enough, we may as well read nothing before doing so. I am very concerned that if I add this:
then none of the part listeners log anything. It feels like we are not doing anything. |
commonBuilder.js is supposed to read it on its own, is that not working? |
I think the actual mistake was that i took the dicer benchmarks. part is not a busboy event but a dicer event. What we can do is to listen to the file event, as we have only one file, and accumulate the size of the provided chunk(s) (=> bytesRead). in finish we could then return the bytesRead. The thing is we dont pipe anything through the file system or so. So it makes actually sense to just listen to the file event and pipe the data into the nirvana. So we should actually also handle the file stream: |
Ah, that part actually comes from Dicer, which explains why it wouldn't work for Busboy which I don't think is passing through all the events it gets from Dicer. But events that Busboy emits are not documented, ant the one used by fastify-multipart ( |
Great point! |
@Uzlopak Pushed the change, it's still not firing any |
It is really strange. Even legacy busboy behaves the same :/ So it is not even something were I could blame that we maybe broke something... |
It ignores the parts in this line. busboy/deps/dicer/lib/Dicer.js Line 157 in 82a9a50
|
Yes, looks like it. |
The payload seems valid. I really dont get it... What is the issue? |
At this point it is easier to setup a fastify instance and run the autocannon against it than writing a benchmark... WTF |
Ok.. the most stupidest thing |
I go to sleep now, knowing I solved this ridiculously issue...
Something went wrong: ENOENT: no such file or directory, open '/home/aras/Workspace/fastify/direct/busboy/benchmarks/_results/Busboy_comparison-@fastify/busboy-Node_12.json' |
@Uzlopak Woooohooo! Awesome, great job! |
I'll wrap up remaining loose ends and prepare it for review. |
@Uzlopak I've added real validators to ensure our results are consistent, and they are sometimes passing, and sometimes failing. Do you have any ideas what could make them randomly fail sometimes? Could be that we actually have a bug in there that makes both implementations sometimes swallow some data or generate some in excess. |
Actually... I think this is because of generating Buffer data. I assume that it fails, e.g. when \r\n is created randomly. What happens if you give a specific string like consecutive 'AAAAAA...'? Does it still fail? |
@Uzlopak You were right, replacing data with deterministic set resolved the issue. This is now ready for review :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
first review, will test now
benchmarks/package.json
Outdated
"benchmark-busboy": "node busboy/executioner.js -c 0", | ||
"benchmark-fastify": "node busboy/executioner.js -c 1", | ||
"benchmark-all": "npm run benchmark-busboy && npm run benchmark-fastify -p high", | ||
"benchmark-all-medium": "npm run benchmark-busboy && npm run benchmark-fastify -p medium", |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"benchmark-all-medium": "npm run benchmark-busboy && npm run benchmark-fastify -p medium", | |
"benchmark-all-medium": "npm run benchmark-busboy -- -p medium && npm run benchmark-fastify -- -p medium", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good job.
No description provided.