The Old New Thing

Performance consequences of polling

Polling kills. A program should not poll as a matter of course. Doing so can have serious consequences on system performance. It's like checking your watch every minute to see if it's 3 o'clock yet instead of just setting an alarm. First of all, polling means that a small amount of CPU time gets eaten up at each poll even though there is ...

There are two types of rebates, and you need to be on the alert

Many commenters to my earlier entry on sales in France had questions about rebates. Slate explained the whole rebate thing back in 2003. The short version: There are two types of rebates, manufacturer rebates and retailer rebates. Manufacturer rebates exist because they want the retail price to go down, but they are afraid that if they just...

If your callback fails, it's your responsibility to set the error code

There are many cases where a callback function is allowed to halt an operation. For example, you might decide to return to the message to prevent the window from being created, or you might decide to return to one of the many enumeration callback functions such as the callback. When you do this, the enclosing operation will return ...

How air conditioning revolutionized competitive bicycling

I'm not really interested in sports. Teams, standings, scores, who got traded to what team, none of that is interesting to me. What I am interested in, however, is "meta-sports": The business of sports, the technology of sports, the evolution of techniques, changes in the rules, that sort of thing. That's one of the reasons I'm a fan of the ...

The cost of trying too hard: String searching

There are many algorithms for fast string searching, but the running of a string search is inherently O(n), where n is the length of the string being searched: If m is the length of the string being searched for (which I will call the "target string"), then any algorithm that accesses fewer than n/m elements of the string being ...

From Doom to Gloom: The story of a video game

NPR's Morning Edition developed a series on the subject of flops, and one of their segments was devoted to the rise and fall of John Romero. You can read more about the phenomenon known as Daikatana in a huge series on Gamespot. Set aside at least an hour if you choose to read it. You can also read the Dallas Observer story that opened ...

The cost of trying too hard: Splay trees

Often, it doesn't pay off to be too clever. Back in the 1980's, I'm told the file system group was working out what in-memory data structures to use to represent the contents of a directory so that looking up a file by name was fast. One of the experiments they tried was the splay tree. Splay trees were developed in 1985 by Sleator and Tarjan ...