• About: Perl core hacker, former Principal Dev and Fellow at You can blame me for hash randomization, and for much of the new regex syntax since 5.10.
  • Commented on Regexp::Assemble - Weekly Travelling in CPAN
    Were you talking to me there?...
  • Commented on Regexp::Assemble - Weekly Travelling in CPAN
    Fwiw, the regex engine automatically performs the trie optimization, and has done since Perl 5.10. These days using these modules will probably slow things down, not speed them up. If you find evidence to the contrary please file a bug...
  • Commented on Ordering Your Tests
    I do get the point that it may be helpful to have a simple test fail early in certain types of testing, and for instance you can hit CTL-C and then start debugging just that test file. But that is...
  • Commented on TWC 205: Exclusive Third Or First
    If modules are allowed, then the following gives pretty much optimal performance, slightly slower than O(N); heapifing an array is O(N), removing the max of the heap is O(Log2(N)). The heapify algorithm is pretty interesting, using the siftDown() algorithm the...
  • Commented on Ordering Your Tests
    FWIW, I think this practice is somewhat questionable. It shouldn't matter what order the test files are run in. It should be possible to run any test file in a distro on its own, without any other test file being...
  • Commented on XS versus clang: Infinite warnings
    Thanks, this was very useful to me. I applied the command line version to Sereal today....
  • Commented on Are Restricted/Locked Hashes A Failed Experiment?
    I'm just restating the question to see if anyone thinks it should be a standard part of the hash api....
  • Commented on Are Restricted/Locked Hashes A Failed Experiment?
    Yes indeed. That is my line of thinking too. So i guess a refined version of my question is: should ALL hashes support locking, or would it be sufficient to have a bespoke lockable hash to use with
  • Posted Are Restricted/Locked Hashes A Failed Experiment? to demerphq

    Some time back we added support to Perl for locked or restricted hashes. (See Hash::Util and The basic idea is that you can set up a hash, and then "lock" it, at which point access to unregistered keys in the hash, either write OR read, will cause an exception.

    The basic idea w…

  • Commented on Send in a Perl aref to C, get back a Perl array (and using the generated XS)
    Your XS code will be more efficient if you bypass Inline::C and use XS directly. On the other hand, the strategy you outlined is a good way to learn XS in the first place. Also, there are modules out there...
  • Commented on Three Sort Functions
    Most of these sort functions should not be used directly, but instead should be recoded to use the Shwarzian Transform, or the Guttman Rosler Transform. Here is an example of a complex sort function that is used in perl core...
  • Commented on Statistics for perl hash tables
    Dont worry about Reini's crazier ideas like sorting things by their hash number. That will never ever ever happen. Its a patently ridiculous idea, completely insecure, and nonsensical....
  • Commented on Statistics for perl hash tables
    Also I should mention you compared against CityHash, which as far as I know is broken in that you can construct a multi-collision attack (what I call a key extension attack above).
  • Commented on Statistics for perl hash tables
    I'd like to clear a couple of things up. First, regarding the hash security changes, we have not published the key discovery attack on the ONE_AT_A_TIME_OLD function, and we have not disclosed the full attack key set I calculated to...
  • Commented on And the fastest OO accessor is...
    Quote from tsee (he cant log in right now - adjectives altered to make sense in context here): Wrong conclusion. Faster than a raw hash? Only if you plan to do parameter validation. Seriously, if you do, pick another language...
Subscribe to feed Recent Actions from demerphq

  • Tom Wyant commented on Ordering Your Tests

    I see your point. A test suite should succeed regardless of the order in which tests are run. Individual test files should be independent, I think of them as independent, and I will see about periodically testing in parallel.

    The thing is, the purpose of testing is two-fold: to demonstrate success and to find failures. But in my experience failures are not often solitary -- more commonly they occur in cascade. When a cascade occurs, it is very handy to the maintainer to have the problem that initiated the cascade come out first, rather than buried in a welter of subsidiary failures. …

  • Tom Wyant commented on Ordering Your Tests

    P.S. The HARNESS_OPTIONS thing should work on whatever tool chain you use, because it acts directly on TAP::Harness.

  • Gábor Szabó - גאבור סבו commented on Regexp::Assemble - Weekly Travelling in CPAN

    Nice, but IMHO it would be better if you (also) published these on so people outside of the Perl community will also see them.

  • Sebastian Schleussner commented on Regexp::Assemble - Weekly Travelling in CPAN

    I agree with @demerphq! I complemented the benchmark with a case that applies the regexp
    $rx = sprintf qr{^(?:%s)$}, join '|', @roman;
    and ran it on seven different setups, i.a. Perl 5.10.1 on i586, Perl 5.26.1 on x64, and Perl 5.32.1 on armv5el.

    In all the cases, this plain-vanilla precompiled RX was fastest, though by how much, differed: 8–25 times faster than the nail-curlingly slow loop through the array, 18%–60% faster than ::Assemble and ::Trie. Only on the i586 was ::Trie faster (by a hair's breadth 1%!) than ::Assemble.

  • C.-Y. Fung commented on Regexp::Assemble - Weekly Travelling in CPAN

    Dear demerphq and Sebastian,

    Thanks for pointing out the optimization done by the Perl compiler! I will post a corrected performance comparison next week.

Subscribe to feed Responses to Comments from demerphq

About is a common blogging platform for the Perl community. Written in Perl with a graphic design donated by Six Apart, Ltd.