#8 increase string speed

open
nobody
None
5
2009-11-03
2009-11-03
Anonymous
No

when parsing a JSON string, it is read, character by character, and then added to the string. This causes a O(n^2) run time as the string is copied for every character added. This patch uses the standard python way of appending to a list, and then ''.join'ing the list at the end.

This patch only improve performance by 1.08% +/- .4% at 95% confidence. Probably would be better to restructure the code so you can read upto a set of characters. It takes about .58 seconds to parse a 144KB string on my 2.33 Ghz Core 2 Duo

Discussion

  •  
    Attachments