holidayextras / jsonapi-server

A config driven NodeJS framework implementing json:api and GraphQL
MIT License
488 stars 115 forks source link

production environment : do not validate output #401

Open olivierchatry opened 6 years ago

olivierchatry commented 6 years ago

Hello, while profiling my back end, found out that most of the time was spent JOIing the output of the different function of jsonapi-server.

While this is very useful while dev-ing handlers, in production it is really eating a lot of CPU for nothing.

This PR add a config option :

jsonApi.setConfig({
    doNotValidateOuput:true
})

That tells the server to not validate the output of handlers. This is false by default.

paparomeo commented 6 years ago

Thank you for the contribution @olivierchatry! I'll look into merging this soon.

olivierchatry commented 6 years ago

Would be very cool if you have time to get this merged :)

paparomeo commented 6 years ago

Apologies for the tardiness. I'm putting time aside this week to review and merge PRs. Thanks!

olivierchatry commented 6 years ago

ho ! no worries, it is already great that you put so much effort in doing this.

On Tue, May 29, 2018 at 9:46 PM Pedro Romano notifications@github.com wrote:

Apologies for the tardiness. I'm putting time aside this week to review and merge PRs. Thanks!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/holidayextras/jsonapi-server/pull/401#issuecomment-392919200, or mute the thread https://github.com/notifications/unsubscribe-auth/ABNXG6esTxEyoTaO2VeY5UGS7OPJ2Jrqks5t3aWmgaJpZM4TlCOX .

olivierchatry commented 5 years ago

Sorry to be a bit pushy again, not sure if you are still planning to integrate this, but it would be nice if it was :)