openfoodfacts / openfoodfacts-server

Open Food Facts database, API server and web interface - 🐪🦋 Perl, CSS and JS coders welcome 😊 For helping in Python, see Robotoff or taxonomy-editor
http://openfoodfacts.github.io/openfoodfacts-server/
GNU Affero General Public License v3.0
664 stars 392 forks source link

Perl code profiling and mod_perl memory leaks tracking and debugging #1796

Open stephanegigandet opened 5 years ago

stephanegigandet commented 5 years ago

What

Part of

CharlesNepote commented 5 years ago

I have no experience in profiling BUT perl benchmark module is really easy to use. It can be a good way to test before/after code changes: https://perldoc.perl.org/Benchmark.html

For a good introduction on profiling and benchmarking, I found: https://www.oreilly.com/library/view/mastering-perl/9780596527242/ch05.html

stephanegigandet commented 5 years ago

I used Devel::MAT and it helped to identify a very big memory leak, details are in https://github.com/openfoodfacts/openfoodfacts-server/issues/2053