Tuesday, August 24

Geek

Little-Known Python Data Structures, Part 213, The Sideways Nesting Iridescent Hash Tree

Well, okay, I'm playing with named tuples some more.  And records too, which are mutable named tuples.  Benchmarks on Tanarotte, a cheap little 3GHz Phenom X4:
Native
tontuple * 1000000: 2.25s 444921.8/s
fromntuple * 1000000: 2.53s 394941.8/s
torecord * 1000000: 2.99s 334648.4/s
fromrecord * 1000000: 2.58s 388138.2/s

Psyco
tontuple * 1000000: 1.78s 561349.0/s
fromntuple * 1000000: 1.25s 803004.6/s
torecord * 1000000: 2.16s 462985.7/s
fromrecord * 1000000: 1.00s 1001112.3/s
And on Aoi, a very expensive 2.93GHz dual Xeon:
Native
tontuple * 1000000: 1.86s 537917.8/s
fromntuple * 1000000: 2.18s 458282.9/s
torecord * 1000000: 2.70s 370085.8/s
fromrecord * 1000000: 2.26s 442421.5/s

Psyco
tontuple * 1000000: 1.70s 588383.4/s
fromntuple * 1000000: 2.24s 445920.3/s
torecord * 1000000: 1.95s 513738.1/s
fromrecord * 1000000: 2.24s 447280.2/s
Which tells me two things.

First: Performance is pretty much a wash, so it's fine to use whichever is best for a given task.

Second: Go for the cheaper AMD server next time.  A 2.6GHz quad-core/dual-socket Opteron retails for about $140; a six-core version for $210.  The Xeon X5670s in our current server run about $1460 each.

Posted by: Pixy Misa at 09:39 AM | No Comments | Add Comment | Trackbacks (Suck)
Post contains 185 words, total size 2 kb.

Comments are disabled. Post is locked.
42kb generated in CPU 0.03, elapsed 0.2016 seconds.
54 queries taking 0.1802 seconds, 292 records returned.
Powered by Minx 1.1.6c-pink.