From WikiChip
schlemiel the painter's algorithm
Revision as of 18:25, 18 January 2015 by Inject (talk | contribs) (Created page with "'''Schlemiel the Painter's Algorithm''' (also spelled ''Shlemiel'') is a term referring to a class of routines that may seem to perform well under small workloads but prov...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Schlemiel the Painter's Algorithm (also spelled Shlemiel) is a term referring to a class of routines that may seem to perform well under small workloads but prove to be highly inefficient as they scale due to needlessly redundant operations that are performed at a lower level. The term was coined by Joel Spolsky in late 2001.

Background

The term is based on the Yiddish joke involving Schlemiel (He שלעמיל) which means an inept clumsy person. Spolsky explained it in his blog as:

Shlemiel gets a job as a street painter, painting the dotted lines down the middle of the road. On the first day he takes a can of paint out to the road and finishes 300 yards of the road. "That's pretty good!" says his boss, "you're a fast worker!" and pays him a kopeck.

The next day Shlemiel only gets 150 yards done. "Well, that's not nearly as good as yesterday, but you're still a fast worker. 150 yards is respectable," and pays him a kopeck.

The next day Shlemiel paints 30 yards of the road. "Only 30!" shouts his boss. "That's unacceptable! On the first day you did ten times that much work! What's going on?"

"I can't help it," says Shlemiel. "Every day I get farther and farther away from the paint can!"