@oltarasenko Took me a little longer than planned, but put together the promised benchmark, which compares the version of the HTML parsing and extraction code from your post against a version using the optimizations I suggested and a Meeseeks translation of the optimized version.
Name ips average deviation median 99th %
Meeseeks 225.19 4.44 ms ±3.55% 4.39 ms 5.02 ms
Floki optimized 166.03 6.02 ms ±7.36% 5.96 ms 7.82 ms
Floki unoptimized 55.46 18.03 ms ±6.26% 17.77 ms 22.34 ms
Comparison:
Meeseeks 225.19
Floki optimized 166.03 - 1.36x slower +1.58 ms
Floki unoptimized 55.46 - 4.06x slower +13.59 ms
Memory usage statistics:
Name Memory usage
Meeseeks 0.42 MB
Floki optimized 6.25 MB - 14.98x memory usage +5.84 MB
Floki unoptimized 20.90 MB - 50.04x memory usage +20.48 MB
You can see the source along with some notes in the benchmark repo.


















