Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

A profiler is for micro optimisations. A profiler won't let you go from bubble to quick sort for example.


A profiler will tell you if sorting actually using a meaningful amount time in your application.

If you go ahead and blindly change your bubble sorts for quick sorts then at best you may be wasting time doing something that has no effect on performance, and at worst you may be making your program slower.

Quicksort is slower than bubble sort for nearly sorted input after all.


It does give you information on where the most time is being spent, but it doesn't tell you what to implement. Without adequate algorithm knowledge you might try a micro optimisation when it really needs a completely different algorithm.

With superficial knowledge you might stick to certain rules without really understanding them. That bubble sort example you gave is a perfect example.


You are operating under the assumption that the performance of an average piece of software is algorithmically limited, this is almost never the case. In average software the core performance characteristics are typically bound by far simpler issues, such as excessive database queries.

A profiler is not good at speed up an algorithm, but a profiler is THE tool you need to speed up a system, and most optimization in the wild is system optimization, not algorithm optimization.

This particular example is a perfect case study in how excessive focus on computer science can lead you astray in software engineering.


In my view, all performance optimisations need to be driven by hard data and a profiler is just one source of this kind of data.


Maybe not, but Google will:)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: