Agner`s CPU blog

Software optimization resources | E-mail subscription to this blog | www.agner.org

Why is my computer so slow?
Author: Shervin Emami Date: 2010-12-29 11:25
Nice summary, I totally agree!

But I think you also forgot to mention the effect of bloated software design, that causes huge delays in memory caches and hard-disk activity. Since even simple applications now use so many runtime libraries and other files, the hard-disk seems to be accessed for almost any operation, thereby significantly limiting the power of a fast CPU and fast memory caches. These days our computers have multiple core CPUs running in the GigaHertz with GigaBytes of fast RAM, and yet it is still expected to have noticeable delays when doing such basic things like opening Notepad or viewing the contents of a folder, and like you said, its still normal to have various sudden delays of several seconds while things update in the background, or large chunks of RAM are shifted between Virtual RAM and Hard-Disk! Obviously Linux is generally better than Windows in this regard, but I'm even surprised at how slow Linux behaves these days.

Its just amazing that software developers never question the idea that a 2 second delay in opening Notepad means about 6 billion CPU cycles, when it should surely be possible in just a few thousand cycles if the Operating System and software were written more efficiently. Programmers believe all the marketing hype that current compilers will automatically generate better code from C/C++/Java than would normally be possible with hand-optimized Assembly code, so everyone just assumes that adding more & more higher layers of abstraction to C/C++/Java/.Net code will just be optimized away by their infinitely wise compiler and automatically make full use of cache & SIMD instructions to their full potential, etc...

Little do they know that while they can expect maybe a 20% improvement in their code by upgrading parts of their hardware, they can expect a 2000% or more improvement by writing highly efficient code that takes advantage of SIMD and other low-level features. Sure it would be great if the C/C++/JIT compilers could generate code as fast as a reasonable Assembly language programmer, but that just seems way too complex to expect compilers to achieve in many years to come.

To see the difference in efficient code and standard code, I just tested my 3D modelling program (Draw3D) I wrote about a decade ago that was hand-optimized for a 75MHz Pentium CPU, and it now runs approximately 50 times faster on my new laptop (using just software rendering without any GPU or SIMD instructions), whereas most software like MS Word & PhotoShop & even Notepad barely run any faster now than they did a decade ago!

 
thread Why is my computer so slow? new - Agner Fog - 2009-10-06
reply Why is my computer so slow? new - Declan Cooper - 2009-11-28
reply Why is my computer so slow? new - Igor Levicki - 2010-01-02
last replythread Why is my computer so slow? - Shervin Emami - 2010-12-29
last reply Why is my computer so slow? new - Agner - 2010-12-29