Hacker News new | ask | show | jobs
by julien-j 1211 days ago
You have a lot of good points that will indeed be addressed in the next posts :)

The operations on the strings are subtly expensive and I was expecting to see them above the accesses to the maps in the perf report. Now they were not and I address the problems in the order of this report, so we will have to wait a bit to discuss them. The intent is also to unroll a scenario of optimization for the reader: measure to get insight, try something, measure again, decide.

If you have the time and the motivation I would love to see a fast but not super optimized version of this program. I tried to keep using the standard library and not going into cryptic code (i.e. trying to keep the code clear for an average programmer), and I stopped when the performance gain became very small, but I am pretty sure we can get better performance if we push further.

1 comments

Going step by step, slowly tackling the issues while also showing the reason behind why it is optimized, is a great way to teach. Congrats on mentorship skills!