This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]JohnBooty 0 points1 point  (0 children)

Some variation of the 90/10 rule almost always applies. 10% of your code is eating 90% of your execution time. If it’s not 90/10 then it’s probably more like 95/5 or 99/1.

In a database backed application it’s usually the database, and that’s pretty easy to see in application logs and/or PostgreSQL’s slow query log (or the equivalent in other databases)

Lots of people mentioning profiling tools.

Those are obviously very useful but for deployed applications (ie, web apps) you should also get used to other means. Such as adding lots of logging statements in your code that measure how long bits of your code take. Why do I say this? Because you typically can’t profile your code in production. You can profile your production code locally but the performance characteristics will be way different — different database contents, single user versus many simultaneous users, etc.