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

Your quote makes me feel like you are targeting code lines/chars.

Less cpu cycles != less lines of code.

For example, bubble sort would be little more than 10 lines where merge sort would be twice as that.



What I was really trying to express is the fact that you cannot make code run faster (on the same machine), but this is something we all say - we made xyz faster. Every line of code you write has a price, both in performance and in security/bugs. Security issues and bugs typically are tied to lines of code, but performance is definitely not.

To really understand this, you have to understand how machines work. Merge sort is faster because the processor does less work for the same input compared to the bubble sort. How many lines of code you have is rarely a good mapping of how much work your processor is doing. You have to take into account the complexity (i.e. O(n) or O(N^2)), the framework your are using (just because you have 3 lines of code in a Rails controller, doesn't mean you are executing 3 lines of code, etc.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

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

Search: