heikkilevanto / beertracker

Simple script to track the beers I drink
GNU General Public License v2.0
2 stars 1 forks source link

Check timings #317

Open heikkilevanto opened 1 month ago

heikkilevanto commented 1 month ago

Add some code to see what takes all the time. I suspect the worst offenders are

But don't trust intuition on performance questions. Measure it. There is a good Perl module for such: Time::HiRes

Add code to measure the key points, and log them into stderr and/or html comments.

heikkilevanto commented 1 month ago

Just looking at the browser console, running at home on the same machine

Would be good to see what Perl can say about the total time spent in the script. Apaches overhead seems to be about 2 ms (reloading the icon)

heikkilevanto commented 1 week ago

Reading the whole file, but parsing only lines for 2024 drops the time from 700 to under 150 ms. So it is the parsing, not reading through the file that costs. Most of the time we don't need to parse all records.

See also #257