HTRDF.c parser performance improvement

Good day,

I've been using the libwww HTRDF component for parsing files. I made a
recent change (diff of HTRDF.c output below) that has improved the
parsing process. In my case, parsing time went from 74 minutes to 4
minutes on a file with a 300K elements. I am not an official hacker and
do not have write access to the CVS repository. So I offer my
contribution via this email. The fix is based on the latest HTRDF.c
file. I attached the updated HTRDF.c file for your revision. Assuming
this is 'hacker approved', can someone put this into the CVS repository?

Regards,

David Brown

 

>     HTList *                  m_lastChild;
233a235
>       me->m_lastChild = me->m_children;
253a256
>       me->m_lastChild = me->m_children;
293c296,303
<     return (me && element) ? HTList_appendObject(me->m_children,
element) : NO;
---
>     if (me && element) {
>       HTList *lastChild;
>       if ((lastChild = HTList_addList(me->m_lastChild, element))) {
>         me->m_lastChild = lastChild;
>       return YES;
>       }
>     }
>     return NO;

Received on Friday, 3 February 2006 22:31:00 UTC