7 ms·
I think if you don’t know it, you are blind to it. We had some AWS lambda function timing out and the person working on it kept adding more and more resources t
by thebigspacefuck 3y ago
I think if you don’t know it, you are blind to it. We had some AWS lambda function timing out and the person working on it kept adding more and more resources to get it to complete on time but it would inevitably slow down again. I took a look at it and realized that they were building a huge array and performing a lookup in it each time. Converting the array to a set immediately dropped the runtime and fixed the issue for good.
- shortrounddev2 3y agoI once had a lambda that was running at like 10mins and timing out. It downloaded a bunch of data from an API, ran some statistical functions on it, and then uploaded it to a database. I found that the biggest performance increase came from async downloads. By sending multiple http requests at once it went from 10 to 2min. After that, optimizing the queries sent to the API reduced the amount of data that had to be downloaded. Finally, I found the best way to bulk upload data to mysql was to use file based uploads which simply copy themselves into the database. Sending 500 inserts at a time was wayyyyy slower. Managed to get it down to 30s. I also switched from python to Java but I never measured the difference between the two