PayU / openapi-validator-middleware

Input validation using Swagger (Open API) and ajv
Apache License 2.0
144 stars 50 forks source link

Replace memoizee with a simpler alternative #152

Closed kibertoad closed 3 years ago

kibertoad commented 3 years ago

memoizee brings in 6 dependencies, that are completely irrelevant for openapi-validator-middleware use-case, as we are not using any expiration policy. This change makes the implementation more lambda-friendly and also helps when bundling with nexe.

kibertoad commented 3 years ago

@kobik Any chance you could fast-track review for this? It's a blocking issue for us :-/

kobik commented 3 years ago

hey @kibertoad my man, have you used nano-memoize before?

kibertoad commented 3 years ago

@kobik I did not, why? Can you recommend another minimalistic memoization solution?

kobik commented 3 years ago

no, i haven't.

just wondering whether to go with micro-memoize which has 150K downloads or this one with 5k downloads.

kibertoad commented 3 years ago

@kobik micro-memoize is 4 times larger and works 2 times slower according to benchmarks, but I'm OK with changing libraries if you recommend it.

kibertoad commented 3 years ago

I can benchmark myself as well

kobik commented 3 years ago

I don't have a strong opinion about either one of them.

Just want to make sure it's working correctly.

kibertoad commented 3 years ago

@kobik I'll write some tests.

kobik commented 3 years ago

thanks @kibertoad

kibertoad commented 3 years ago

@kobik Done!

kibertoad commented 3 years ago

@kobik Could you please take a look?

kibertoad commented 3 years ago

@kobik Could you publish a new version with this? #153 will be a semver major, so it's not worth it to wait for it.

kobik commented 3 years ago

published

kibertoad commented 3 years ago

Thank you!