DEV Community

Discussion on: I made Express faster than Fastify (100x faster JSON, also NestJS)

Collapse
 
eram profile image
eram • Edited

Hi. One thing I don't get in your benchmarks: in your Fastify code you are running with a schema validator, but in your Express code you are only replacing the default JSON parsing. How is that even comparable?

Collapse
 
samchon profile image
Jeongho Nam • Edited

Benchmark program of current article does not have request body data. It has only response body data. Therefore, if your "schema validator" means a response data validation before JSON serialization, I wanna say that typia.isStringify() and typia.assertStringify() are doing it.

Otherwise, you're meaning request DTO validation, and what you want to say is "this benchmark program does not handle request DTO validation", I want to introduce below article. Although below article's benchmark program is not measuring the pure request DTO validation logic of fastify, I think it may helpful for you.

By the way, reading your comment, I think that I should enhance above linked article's benchmark program. I'll add pure-fastify component in the benchmark pogram, so that resolve your question clearly. By the enhancement, five componets would be compared:

  • NestJS + express
  • NestJS + fastify
  • NestJS + nestia + express
  • NestJS + nestia + fastify
  • pure fastify
Collapse
 
samchon profile image
Jeongho Nam
Collapse
 
guridocodigo profile image
Guri do Código

And how is the development of the plugin for fastify going?

Thread Thread
 
samchon profile image
Jeongho Nam

Plan to start at 2023-09. Sorry for delaying

github.com/samchon/schedules/blob/...

Thread Thread
 
guridocodigo profile image
Guri do Código • Edited

Thanks, and do you intend to support SWC?

Thread Thread
 
samchon profile image
Jeongho Nam

Not possible to support SWC, because it removes every types like Babel