Re: While we're at it
Simon Casady <[email protected]> Fri, 2 Apr 2010 07:47:46 -0500
| Newsgroups | gmane.network.djbdns |
|---|---|
| Message-ID | <[email protected]> |
I agree, a very good paper worth reading more than once. However I can't resist adding a couple of more stories, thoughts on the subject of optimization. There once was a processor from att that had strlen as a single opcode, one complex instruction. It was convenient but it turned out to actually a little slower, in the real world, than test increment loop with simple instructions. (also a cics rics comparison on the same cpu !). The problem was interrupts. It took too long to save all that state and restart the instruction and it had to be interruptible. Point being you have to profile to know whats faster. The other experience I had was with an early version of AIX. Being curious and not wanting to do the work my boss wanted done I did some test with disk IO. I tested clib stdio, read write system calls(page size), and mmap. To my surprise stdio won every time. Apparently the people at IBM knew more than I did. The point here is that if you are not intimately acquainted with all the features and quirks of a system, just keep it simple and of course profile.