<div dir="ltr">What I'm worrying is this. Let N be the number of symbols in all input files and M be the number of symbols that appear in version scripts.<div><br></div><div>If there's no pattern matching in version symbol script, then the cost of setting versions is O(M). We call SymbolTable::find(StringRef) for each symbol from version scripts and set a version to the return value.</div><div><br></div><div>But if we allow patterns, the cost becomes O(N). Even though is better than O(N*M), it is a large number. M is order of hundreds or thousands, but N can be as large as order of millions.</div><div><br></div><div>So I think we should avoid pattern matching to symbols.<br><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Apr 30, 2016 at 7:46 PM, Rafael Espíndola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">No idea why this just came to mind, but anyway:<br>
<br>
I remember you mentioning that one annoying thing about version<br>
scripts is the need to match each symbol against multiple possible<br>
regular expressions (globs?).<br>
<br>
But I just remembered that that can be done efficiently. Multiple<br>
regular expressions can be tested at once. They are all just NFAs :-)<br>
<br>
Cheers,<br>
Rafael<br>
</blockquote></div><br></div></div></div>