Yes, lc() is rocket fast because this only involves fiddling with one bit within a byte. C and ASM can do this very, very quickly. This is just a minor point in the OP's code. This is in a "run once" initialization loop. No optimization here will make any difference at all in terms of user perceived performance.
The OP does have a correct idea in that running a regex against all lines of the input dictionary will be so fast, that the complexity of that regex probably makes no difference at all. The idea of throwing away extraneous results that are either too long or too short in terms of number of characters also probably makes no difference.
I think the problem here is that we do not have clearly defined textual description (meaning something that a human can understand) of what the code is supposed to do! Nobody here can "fix" code that doesn't do what it is supposed to do, if we don't know what it is supposed to do in the first place!
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|