December 25, 2006

System | CPU | Clock | Python | Loop | String | Scan | Total |
---|---|---|---|---|---|---|---|
Amelia | Core Duo | 1.66GHz | 2.5 (Win) | 1.243 | 3.158 | 1.033 | 5.434 |
Amelia | Core Duo | 1.66GHz | 2.5 (Win)+Psyco | 0.037 | 0.483 | 1.190 | 1.710 |
Amelia | Core Duo | 1.66GHz | IronPython 1.01 | 0.698 | 2236.319 | 2.045 | 2239.062 |
The answer: My benchmark does a lot of string concatenation, because Minx does too. But Minx and my benchmark both perform just fine because CPython has a very useful optimisation for its string concatenation.
A naive approach (typical of early Microsoft Basics, for example) would create a new string each time: new_string = old_string + whatever. In my benchmark, though, that would cause an aggregate of about a terabyte of memory traffic. You can see that CPython doesn't use a naive approach, because my notebook doesn't have 300GB/second of memory bandwidth, let alone the 2TB/second indicated by the Psyco results. CPython leaves room at the end of objects for them to grow; it updates the data in place and only copies the object when it runs out of room. Simple things like that can make a big difference. Like a factor of 5000, in this case.Posted by: Pixy Misa at 01:57 AM | Comments (37) | Add Comment | Trackbacks (Suck)
Posted by: Andrew at December 26, 2006 08:56 AM (81C4m)
http://text.inguaro.com/6602bf862513c92ade4ac57f271812d8
6602bf862513c92ade4ac57f271812d8
Posted by: Deven at March 10, 2009 12:44 PM (4NdWV)
[url]http://bb2.inguaro.com/6602bf862513c92ade4ac57f271812d8[/url]
6602bf862513c92ade4ac57f271812d8
Posted by: Deven at March 10, 2009 12:44 PM (4NdWV)
[url]http://bb2.inguaro.com/d94c7cfd00b5597f9084d3cc1d76de1a[/url]
d94c7cfd00b5597f9084d3cc1d76de1a
Posted by: Oliver at March 18, 2009 02:29 AM (rC3SE)
http://text.inguaro.com/d94c7cfd00b5597f9084d3cc1d76de1a
d94c7cfd00b5597f9084d3cc1d76de1a
Posted by: Oliver at March 18, 2009 02:29 AM (rC3SE)
http://babiesindanger.com/games/customized-photos/?Seal
michelle marsh
http://babiesindanger.com/games/customized-photos/?michelle-marsh
Justin Bartha
http://babiesindanger.com/games/customized-photos/?Justin-Bartha
Jordin Sparks
http://babiesindanger.com/games/customized-photos/?Jordin-Sparks
Brooklyn Beckham
http://babiesindanger.com/games/customized-photos/?Brooklyn-Beckham
Liliane Ferrarezi
http://babiesindanger.com/games/customized-photos/?Liliane-Ferrarezi
melanie brown
http://babiesindanger.com/games/customized-photos/?melanie-brown
Cindy Crawford
http://babiesindanger.com/games/customized-photos/?Cindy-Crawford
Mariah Carey
http://babiesindanger.com/games/customized-photos/?Mariah-Carey
Rihanna
http://babiesindanger.com/games/customized-photos/?Rihanna
Posted by: Kai at April 22, 2009 05:24 AM (qGSJx)
http://basic.thedci.org/games/photos-kisses/?prick-photo
industrial accident photo
http://basic.thedci.org/games/photos-kisses/?industrial-accident-photo
indian art photo
http://basic.thedci.org/games/photos-kisses/?indian-art-photo
salli richardson photo
http://basic.thedci.org/games/photos-kisses/?salli-richardson-photo
virgin island photo
http://basic.thedci.org/games/photos-kisses/?virgin-island-photo
photo universal
http://basic.thedci.org/games/photos-kisses/?photo-universal
henry t. sampson photo
http://basic.thedci.org/games/photos-kisses/?henry-t.-sampson-photo
canadian landscape photo
http://basic.thedci.org/games/photos-kisses/?canadian-landscape-photo
photo editing softwares
http://basic.thedci.org/games/photos-kisses/?photo-editing-softwares
photo of ingrown hair
http://basic.thedci.org/games/photos-kisses/?photo-of-ingrown-hair
Posted by: Seth at April 25, 2009 10:36 PM (ygFmi)
Processing 0.01, elapsed 0.0159 seconds.
16 queries taking 0.0114 seconds, 29 records returned.
Page size 13 kb.
Powered by Minx 0.8 beta.