Re: While we're at it
Dean Anderson <[email protected]> Mon, 5 Apr 2010 17:59:18 -0400 (EDT)
| Newsgroups | gmane.network.djbdns |
|---|---|
| Message-ID | <[email protected]> |
On Fri, 2 Apr 2010, Simon Casady wrote: > 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. I386 can also do this with REPZ. > 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. Exactly. > 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. Stdio probably buffers more efficiently. --Dean -- Av8 Internet Prepared to pay a premium for better service? www.av8.net faster, more reliable, better service 617 256 5494