Yelp / bravado-core

Other
109 stars 98 forks source link

Use partials as they do not introduce the overhead of wrapping functions #338

Closed macisamuele closed 5 years ago

macisamuele commented 5 years ago

Double checking the performance improvements of #336, I've noticed that the final version (the one that has been merged) does have equivalent performances of the "original" code.

Comparing performance results between the individual commits I've found a specific commit responsible for the majority of the performance issues: https://github.com/Yelp/bravado-core/commit/bfa6ceec0cf817a397841602a1a4b4281e8fd77e

In order to restore performances, this PR is going to re-introduce the usage of partials. The drawback of partials is that we might not have accurate type checking on the arguments of the function, but it provides way better performances that a normal function call.

Raw data on https://gist.github.com/macisamuele/785ae30d49ab94244734fb5697930893 The changes, introduced during the #336 did reduce the improvements but #337 should help as well

coveralls commented 5 years ago

Coverage Status

Coverage decreased (-0.01%) to 97.885% when pulling 8a330147b186d070c67a33a2979e3f399ef5fa35 on macisamuele:maci-unmarshal-uses-partials into eadfd84d617d6f2bae1f44e06f6c8b551882f0a6 on Yelp:master.