Bug#732836: ben: tracker could do with a performance enhancement
On 2013-12-22 13:15, Stéphane Glondu wrote:
> Le 22/12/2013 13:03, Niels Thykier a écrit :
>>>> In particular, it seems to be very slow for ben files containing a lot
>>>> of "OR" relations; even if these are exact package names (see attached
>>>> file).
>>>
>>> Did you try:
>>>
>>> .depends ~ "foo|bar"
>>>
>>> instead of:
>>>
>>> .depends ~ "foo" | .depends ~ "bar"
>
> Sorry, I actually meant ~ /foo|bar/
>
Ah, okay. Though it triggers a "Pcre.Error" with the rewritten
auto-linux file:
"""
Generating (ongoing) auto-linux
E: Pcre.Error(_)
"""
I suspect that the underlying regex engine does not like that enormous
expression. Besides that, it does seem to work and it takes only 3
minutes (excluding the above mentioned file for obvious reasons).
If you want, I can send you the resulting file that ben/Pcre doesn't like.
> The code for ~ "foo" does indeed look suboptimal (to say the least)...
>
:)
>> Thanks for the tip; it does seem to improve the general performance of
>> these files considerably. Now all 40 files on release.d.o are processed
>> in 3m and 30 seconds[1]. Previously it was 7 minutes excluding the one
>> I attached (which seemed to take more than 20 minutes alone).
>
> Is the result right with double quotes?
>
By the looks of it; no.
>> It does not seem like the "|" inside a string is documented on ben.d.n[2].
>
> It is captured by <regex>.
>
>
> Cheers,
>
:)
~Niels
Reply to: