Your program is already heavily invested in the performance of hashes. Most objects use hashes as their underlying data structure. Every reference to a package variable results in multiple hash lookups (I think). And every call to a subroutine results in multiple hash lookups (I think).
Well, then, think again. :)
To the first approximation, only packages use hashes for their internal structure, and most package symbol lookups happen only at compile time. (Any stored GV* is post-hash-lookup.) Apart from symbolic references (which are discouraged), the only major operation that historically used hash lookups implicitly at run time was method calls, and I think even that has been heavily optimized these days when the method name is known in advance.
There are other implicit uses of hashes, but these typically come into play only when you start using higher Unicodes characters in patterns, and even there the internals typically try to avoid using the hash in the common cases.
In any event, normal sub calls don't use any implicit hashes. They're already too slow as it is...
-
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.
|