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
Fail to reproduce benchmark results with a bigger payload #178
Comments
Hi! I'm trying to run the suggested benchmarks but I've some problem to reproduce them. ExpressJs code: see here Fastify code: 'use strict'
const fastify = require('../')()
fastify.get('/', function (req, reply) {
reply.send({ hello: 'world' })
})
fastify.listen(3000, function (err) {
console.log('Listen at localhost:3000')
}) ExpressJs result
Fastify result
NodeJS 6.9.4 Can you share the exactly code you're benchmarking? We care about performance so any reports are welcome! |
Thx for you quick response ! |
Confirmed, the bottleneck in the big case is IMHO this should not happen, and we should also disable it in fast-json-stringify when used with this library. We should throw an exception if there are circular dependencies. I'll prepare a PR. Given the overall performance of the "big" case is limited by
|
See reference here |
Thx for having investigated it ! Indeed, specifying a schema for the 'big' test, I see an increase of 25% performance vs without schema, and thus fastify match Express performance : fastify
express
|
Good idea, circular dependencies are not common cases.
question moved to #190 |
Hi, and congrats for this new project,
however, I fail to see any significant performance gain of this module over Express :
express 4.15.4
fastify 0.26.2
Pc : Intel(R) Core i7-6500U CPU@2.50GHZ 2.59GHZ 8;00Go RAM
OS : Windows 10
My sample code is minimalist and exactly the same as https://github.com/fastify/fastify/blob/master/benchmarks/express.js
and only differ by the amount of data sent back :
The two JSON files of data are loaded in memory with require() at the top of the module.
What do you think of these figures ?
The text was updated successfully, but these errors were encountered: