2 ms·
I love hash tables. They're my favorite data structure, maybe. A story: Back in the 70s it appeared that every major state university had to do their own vers
by kabdib 14y ago
I love hash tables. They're my favorite data structure, maybe.
A story:
Back in the 70s it appeared that every major state university had to do their own version of PL/1. At the University of Maryland it was called PL/UM. I don't know why, maybe it was a testosterone thing ("IBM took a zillion man-years to write PL/1, but look what WE did with three starving grad students, a half-soused half-professor and a keypunch operator!") (Yeah, another version of PL/1, and that doesn't necessarily make the world a better place. Anyway --)
PLUM was notorious for being slow (I don't know about bugs, but they were probably there, too), and it was pretty common for students using PLUM to have to grovel for more seconds of CPU time.
Five or six years into PLUM's use as a student language, someone discovered that all of the symbols were being hashed into the same bucket.
PLUM got amazingly fast (well, faster, at least) after that. But by then anyone with a clue had managed to scam an account on one of the bsd Vaxen and write their stuff in C.
Don't take hash tables on faith. Measure, measure, measure.