please icon indicating copy to clipboard operation
please copied to clipboard

Some small optimisations

Open peterebden opened this issue 1 year ago • 2 comments

Reduces one allocation in provideFor and a few other things in paths of varying temperatures (notably getting rid of fmt.Sprintf which isn't the most efficient way to put strings together, although it is fairly concise). Before:

INFO: Run 1 of 5
INFO: Complete in 9.62s, using 6172140 KB
INFO: Run 2 of 5
INFO: Complete in 9.18s, using 5655136 KB
INFO: Run 3 of 5
INFO: Complete in 9.62s, using 6437840 KB
INFO: Run 4 of 5
INFO: Complete in 9.68s, using 6682404 KB
INFO: Run 5 of 5
INFO: Complete in 9.61s, using 6525640 KB
INFO: Complete, median time: 9.62s, median mem: 6437840.00 KB

After:

INFO: Run 1 of 5
INFO: Complete in 9.42s, using 6408832 KB
INFO: Run 2 of 5
INFO: Complete in 9.30s, using 6354172 KB
INFO: Run 3 of 5
INFO: Complete in 9.18s, using 6287200 KB
INFO: Run 4 of 5
INFO: Complete in 9.28s, using 5919368 KB
INFO: Run 5 of 5
INFO: Complete in 9.40s, using 6682712 KB
INFO: Complete, median time: 9.30s, median mem: 6354172.00 KB

peterebden avatar Oct 02 '24 16:10 peterebden

What benchmark are you running in your before/after?

toastwaffle avatar Oct 02 '24 16:10 toastwaffle

What benchmark are you running in your before/after?

The performance one we run after merge (//tools/performance:parse_perf_test)

peterebden avatar Oct 03 '24 13:10 peterebden