[File] [PATCH] Magdir/make: combine regex into single multi branch regex

Dirk Müller dirk at dmllr.de
Fri Mar 11 23:47:29 UTC 2022


There's probably something that I'm missing here, as I'm not deeply
familiar with file(1). During
benchmarking I found that matching for make always shows up in the profiles.

As far as I can see we can combine multiple regexes into a single one
using branches, which is a lot faster and reduces the total number of
rules, lowering the memory footprint
a bit. In combination with the regex-compilation caching this improves
matching over the linux kernel tree by over 30%.

Why was this done the previous way?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-make-combine-regex-magics-into-single-with-multi-bra.patch
Type: text/x-patch
Size: 1828 bytes
Desc: not available
URL: <https://mailman.astron.com/pipermail/file/attachments/20220312/9e3706c8/attachment.bin>

More information about the File mailing list