~bzr-pqm/bzr/bzr.dev

Viewing all changes in revision 5365.5.2.

  • Committer: John Arbash Meinel
  • Date: 2010-08-03 21:14:45 UTC
  • mto: This revision was merged to the branch mainline in revision 5390.
  • Revision ID: john@arbash-meinel.com-20100803211445-yfaqzmzvf8ybi28a
Parse times are dramatically improved.

using _LeafNode directly, the total parse time is actually 369us.
Putting all the items into a 'dict' ends up costing 250us by itself,
and a minor overhead to put that into the _LeafNode object itself.

Switching it around to call parsed(buffer...).all_items() to actually
construct the items again, and we see that it costs another 120us for
the _LeafNode implementation (which has to sort), while the Pyrex
implementation goes from 50us to parse, to just 120us to create all
the objects and return them.
It doesn't have to sort, because they are stored in sorted order.
all_keys() is even better at 94us vs 454us.
I'm rather impressed that PyString_FromFormat is actually pretty
reasonable. Certainly inefficient overall (since we'll eventually
parse back into ints again), but does a good job.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: