In any case, if you are trying to optimize microsecond usage in AWS lambda I hope you have a truly gargantuan amount of traffic and/or have incredibly cheap engineers or the money saved will barely match up to the cost of the engineering hours sunk into them.
https://andre.arko.net/2018/10/25/parsing-logs-230x-faster-w...
two minor follow-ups on that as well:
* https://andre.arko.net/2019/01/11/parsing-logs-faster-with-r...
* https://andre.arko.net/2022/03/13/parsing-logs-faster-with-r...
Additionally for the case mentioned, the log parsing apparently already fit quite comfortably in the free tier of AWS lambda. Rubygems.org seems to get its developer time for free, so Andre can keep tuning this log parser as a hobby experiment (in the best sense of the word, nothing wrong with having fun). But TFA was about building a startup and most of those definitely don't manage to get their devs to work for free.