Re: [evolution-patches] Optimise vCard parsing



On Fri, 2005-08-05 at 14:37 +0800, Not Zed wrote:
> If your changes make any practical difference, it is probably worth a
> closer look.  By just doing one line at a time you should improve
> locality of reference even more, it does slightly less work anyway, and
> will use less memory as a bonus.

Right, new patch at http://bugzilla.gnome.org/show_bug.cgi?id=312581.

It doesn't duplicate the string when it starts, and it doesn't unfold
the entire string at the beginning.  Instead there is a little extra
logic (wrapped in a #define) which handles the newlines.  It also keeps
track of normal characters and copies those into temporary GString in a
single call (with g_string_append_len) rather than calling
g_string_append_unichar repeatedly.

With this patch vCard parsing is twice as fast.  In my benchmarks of
EBookView performance, vCard parsing is the main bottleneck.

It appears to work for me, and works correctly against a number of tests
I tried, but sadly there is no vCard parsing regression test.  Thus, I'd
appreciate people having a good look at the code and trying it against
any weird vCards they have (e-d-s/addressbook/tests/vcard/dump-vcard.c
is useful).

Ross
-- 
Ross Burton                                 mail: ross burtonini com
                                          jabber: ross burtonini com
                                     www: http://www.burtonini.com./
 PGP Fingerprint: 1A21 F5B0 D8D0 CFE3 81D4 E25A 2D09 E447 D0B4 33DF





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]