Hacker's Delight
Hacker's Delight is an impressive compendium of clever tricks for programmers. Warren concentrates on micro-optimizations -- few of the tricks in this book operate on more than 3 or 4 words of memory -- and he displays an impressive knowledge of diverse computer systems in the process.
Who Should Read This Book
Hacker's Delight is hardcore in its presentation and subject matter. I would not recommend this for a beginning programmer -- to fully understand the material requires at least some knowledge of concepts such as Assembly and Machine languages. However, anyone who writes performance-critical software should read this book, even if they do not plan to write Assembly code, both to learn the tricks given, and to learn the concepts behind them.
What's Good
The book is organized into chapters where Warren presents related tricks. In each chapter, he presents a few tricks which perform related tasks -- for example, in Chapter 3, he presents tricks for rounding (up or down) to the next power of 2, rounding to a multiple of a known power of 2, and detecting power-of-2 boundary crossings (i.e., checking for page faults). For each trick, he discusses why it works, whether the technique is generally applicable, related tricks which might be better in specific situations, and where a trick might be used in the real world.
Warren keeps his discussion architecture-neutral, while noting optimizations and problems for specific architectures for specific tricks -- in the process, he displays a vast array of knowledge about specific processors, from 1960's mainframes to x86, MIPS, PPC, Alpha, and others. He also skims the surface of hardware-design issues in a few places -- for example, he devotes a page or two to explaining why computers use base 2 for arithmetic, and why this is the most efficient choice.
What's Bad
This is an extremely dense book, and there are sections which are difficult to understand. Furthermore, there are many tricks which, while interesting, would be difficult to apply to real-world applications, and use of these tricks does violate the Keep It Simple, Clock Cycles Are Cheap And Someone May Have To Understand Your Code philosophy which is harped upon so heavily (not without reason) in modern software design. However, someone writing a compiler or high-performance code may feel that the benefit outweighs the potential risk.
The Summary
If you want a better understanding of the hardware on which your code runs, or you need to squeeze clock cycles, or you just enjoy seeing clever tricks, this is an excellent book. If you primarily use high-level languages such as VB, perl, python, etc., this may not be the right book for you. Be prepared for very dense material.
You can purchase Hacker's Delight from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
Almost as interesting as those lovely discrete math textbooks were. This sounds more like 'Optimizer's Delight.'
To be honest, 'Hacker's Delight' sounded more like a cookbook title.
--------
Free your mind.
i said a hip hop a hippie the hippie
to the hip hip hop, a you dont stop
a rock to the bang bang boogy say upchuck the boogy,
to the rhythm of the boogity beat.
now what you hear is not a test, i'm hacking to the motherfuckin beat
and me, rob malda, and the rest are gonna try and move your feet
see i am timothy and i'd like to say hello
to the ACs, freaks, and logged-in kooks, and all the goatse trolls
but first i gotta bang bang the boogie to the boogie
say up jump the boogie to the bang bang boogie
let's rock, you dont stop
rock the rhythm that will make your body rock
well so far youve heard my voice but i brought two friends along
and next on the mike's my man hemos
come on, hem, sing that song
...is the exact oposite of afternoon delight, I would imagine.
I said a hip, hop, hippy, hippy to the hip hop hacking you don't stop a hacking until the bang bin boogie said backslash the boogie to the rhythm of the boogity beat..
What you hear is not a test, I'm hacking to the beat. And me, the compiler, and my code are gonna start to move your screen.
See, I am das MB and I'd like to say hello
To the linux loners and the mac fairys and the losers on windows.
But first I gotta..bang slash bin slash P E R L said hack kernel yes hack hack the kernel until the whole machine runs like hell.
Proper.
Hey freaks: now you're ju
manipulate computers into doing more work on their part with less work on yours
To paraphrase the great Terry Pratchet: "Beware labour saving devices which are smaller than their manuals".
Ingrate! If it weren't for me, it'd be running gene sequences all day and night. Computers have no sense of perspective.
will it teach me how to hack Windows ME??? It's so hard -- I can't figure it out!
3313 bytes in body
I almost thought that was 31337 or something!