beberlei / assert

Thin assertion library for use in libraries and business-model
Other
2.41k stars 188 forks source link

Improve performance of Assertion Chain class #318

Closed scyzoryck closed 2 years ago

scyzoryck commented 3 years ago

Hello!

During testing performance of the package with PHPBench I've realised that Reflections methods and checking if method exists takes a lot of time. With the simple fixes we can cut execution time by around 10-15% for lazy assertions.

Benchmark can be found here: scyzoryck/php-validators-benchmark

I'm attaching blackfire profiles:

scyzoryck commented 3 years ago

@beberlei - is there any change to take a look at this changes, please? :)

beberlei commented 2 years ago

@scyzoryck thank you very much! :bow: