Rewriting improved gnats converter

Daniel Berlin dberlin at dberlin.org
Wed Apr 16 17:51:06 UTC 2003


On Monday, April 14, 2003, at 05:25  PM, Jonathan Schatz wrote:
>
>>> granted, there is a lot of processing that happens, and we're not 
>>> doing
>>> anything remotely close to a 1:1 mapping between the gnats + bugzilla
>>> schemas, but still.
>>>
>> We don't either.
>
> i profiled my code with dprof, and it didn't tell me anything i didn't
> know (ie, 95% of cpu time was spent in
> VMware::Gnats->convert_pr_to_bugzilla). i think most of the slowness
> comes from reading gnats pr's off of a nfs mounted hd.

Unlikely, i've actually done this before with no speed problems.
If your gnats pr parser is used in convert_pr_to_bugzilla (i'm not sure 
which functions do what in your version, of course :P)  looks anything 
like read_pr in contrib/gnats2bz.pl , that might be the cause of your 
slowdown.
1. The way it's written is just very slow. For every line, it tries to 
match every possible field against it.
2. Worse, the way the re's are written (/^$field:\s*$/) means they are 
compiled and thrown away once for every field and every line, rather 
than reused, because they are dependent on the value of $field.
3. The parse_pr code from gnatsweb was cleaner and smaller and faster, 
so i had borrowed that in my gnats2bz.pl.


>
> anyway, i'd love to glance through your code, although the chance of
> rewriting mine right before launch is pretty slim :-)
>

It's been attached to bug 126252 on bugzilla.mozilla.org

--Dan




More information about the developers mailing list