mpourismaiel / mpourismaiel.github.io

My portfolio+blog
https://mpourismaiel.com
2 stars 0 forks source link

Why you should benchmark your code #2

Open utterances-bot opened 4 weeks ago

utterances-bot commented 4 weeks ago

Why you should benchmark your code

Benchmarking and writing fast code is a crucial part of software development. Learn how to write faster code and why you should benchmark your code.

https://mpourismaiel.com/blog/why-you-should-benchmark-your-code

mehrad77 commented 4 weeks ago

Enjoyed reading it but one thing that comes to my mind is how to benchmark code when it requirers external dependency? Because usually in projects I work on the bottleneck seems to he the database queries or HTTP requests.

mpourismaiel commented 3 weeks ago

@mehrad77 With dependencies there's always a judgement call on whether the maintainers would continue to keep the module stable and performant. That means making sure the dependency is used by other people that would hopefully keep an eye on it alongside you and help out if some issue pops up. The bad thing about relying on other people's work, especially unpaid experts is that they might get busy and not get to upgrading the project. With that said, you should always do your own checks to make your product is the same which is done by integration testing and possible benchmark tests. I prefer to do the benchmarks on my own codes and check the dependencies separately and preferably in isolated situations. This allows me to make sure my integration and supporting code is as performant as I want it to be and prevents me from blaming someone else :smile: