user-pic

Dana Jacobsen

  • About: I've been using Perl since 1991 (4.010 or so). At some point I realized that while I have used many languages, I enjoy using Perl more than any others.
  • Commented on Alternatives to rand()
    Thanks for the note. You are correct that if run on machines with AES support (which is a *lot*, and OpenSSL supports a huge number of them) and if the software supports it, then indeed it's very fast. I added...
  • Commented on Alternatives to rand()
    Peter, some modules offer this (ntheory, Crypt::Random, Crypt::Urandom) but none of them do a rand() style interface to it. It would be easy enough to create. On my Macbook, bulk reads from /dev/urandom run at 12 MB/s, which would make...
  • Posted Alternatives to rand() to Dana Jacobsen

    I recently added some functionality for random number generation to my modules, which led me on a digression about rand(). This is a short look at some modules for getting random floating point values. A later one will look at random ints and bytes.

    ="Table showing modules…

  • Commented on Base conversion
    Thanks! I added a small paragraph about Perl 6. The example on RosettaCode (http://rosettacode.org/wiki/Non-decimal_radices/Convert#Perl_6) shows how easy it is for standard bases 2-36, and I love how there's no wonkiness with int/double/bigint....
  • Posted Base conversion to Dana Jacobsen

    Earlier this year I added some commands to the ntheory module, inspired by Pari/GP and Mathematica, to split numbers into digits and put them together again. Of course this isn't terribly exciting by itself since Perl has split and join, but with optional bases it gets more interesting.

    I…

  • Posted Short survey of modules for combinations and permutations to Dana Jacobsen

    This is a short look at some modules for generating combinations and permutations. There are likely more modules that aren't listed. RosettaCode has examples of writing the combinations and

  • Commented on Stop Putting AUTO_INCREMENT IDs in URLs
    laumers, by "guessable hashes" you mean 32 random hex digits? How is that guessable? Note I did not say to hash the id, as that would indeed be guessable. I said encrypt, e.g. $cbc->encrypt($id,$key,$iv);...
  • Commented on Stop Putting AUTO_INCREMENT IDs in URLs
    If you want to use random-like ids, you could use your convenient autoincrement internal application number, then do a simple encryption of the number. That makes more sense to me than a random UUID, in that it will look and...
  • Commented on Perl6 Pi and continued fractions
    This is tangentially related as it isn't looking at rationals. I've seen a few places that use something like: Pi(n) that gives n digits of Pi. I added that to the Perl5 ntheory library a couple months ago, though I'm...
  • Posted Partitions of an Integer to Dana Jacobsen

    integer partitions comes up regularly, with multiple threads over the years at PerlMonks, a big chunk of ="http://hop.perl.plover.com/book/pdf/05FromRecursionToItera…

  • Commented on Learning Perl 6 - Find in a Large File
    I was having a similar issue, but on a larger file (32M 64-bit integers, about 120x larger than /usr/share/dict/words on my machine). This is more than I'd like to pull into an array, as it uses 13.5GB of memory. Using...
  • Commented on A comparison of memory use for primality modules
    I had tried adding trial division with no better performance, but that last was the clue. For small sizes, when not using Montgomery math, I have trial division using unsigned ints. This almost halves the time on the AIX/Power7 machine...
  • Commented on A comparison of memory use for primality modules
    Perl 5.21.3 built on AIX 7.1 Power 7, 64-bit. Unfortunately building things on AIX is a PITA -- I gave up trying to get GMP, Math::Pari, or ExtUtils::CppGuess (used by Math::Prime::FastSieve) to work. Measuring memory use is non-obvious for fast-running...
  • Commented on Link to public version control system (GitHub or otherwise)
    Thanks for the reminder. It looks like two modules I updated for CPAN day aren't showing up because I forgot to add the meta-spec entry. I made sure I added the repository, but it seems without that it just tosses...
  • Commented on A comparison of memory use for primality modules
    Brian, that's really a different question. This started out as just a "how much memory is used just to load the module without doing anything" but then I figured I should call a single function. Then figured I may as...
  • Posted A comparison of memory use for primality modules to Dana Jacobsen

    Performance and memory use are two areas of concern for many libraries. to reduce memory use, and bulk88 helped really tweak some of the XS. I thought I'd pick a simple …

  • Commented on Perfect Hashes and faster than memcmp
    Very nice. Thanks for making useful open source software and writing about it....
  • Commented on Classify your RT tickets on CPAN Day!
    First a big thanks for all this blogging. I think it is fantastic that you're doing this! Math::Pari probably needs a co-maintainer with lots of time. So far I don't think anyone qualified has wanted to step up. It's a...
  • Commented on vec is slow, little-endian and limited
    When making my Data::BitStream and Data::BitStream::XS modules I did a bunch of vec() manipulation, including versions using Bit::Vector, strings, and my own XS. In many cases what I found was that often just using string storage was faster than Bit::Vector,...
  • Commented on Give your modules a good SYNOPSIS
    Toby, thank you very much!...
  • Commented on Give your modules a good SYNOPSIS
    Thanks for the reference to Test::Synopsis. Is there an easy way to get it to load feature say? It's unhappy with lots of my examples: "Do you need to predeclare say?" One thing I ended up adding to my test...
  • Commented on Giving up on weekly neoCPANisms
    * Anything that involves fixing existing modules instead of creating more. Could even be weighted by # reverse dependencies or ++'s (so an applied bug fix to a common module would be worth lots of points). * Longest chain of...
  • Commented on Math::Prime::Util, May update
    Nate, if your platform has GMP, then Math::GMPz or Math::GMP are great. Similarly, if you're using the right platform then Math::Int128 is nice. But those modules don't work on lots of machines out there. I am going to do a...
  • Posted Math::Prime::Util, May update to Dana Jacobsen

    Math::Prime::Util 0.41 was released, with new functions (valuation, invmod, vecsum, binomial, forpart), and the usual crop of performance improvements. In particular, primality testing on x86_64 got another big speedup.

  • Posted Fun with binomials to Dana Jacobsen

    I decided to add a binomial(n,k) function to Math::Prime::Util, and found some interesting things while doing it. Overflow detection and mitigation in C and Perl were the first thing. Next was looking at negative arguments, which led to…

  • Posted Math::Prime::Util, April update to Dana Jacobsen

    Math::Prime::Util, and the optional Math::Prime::Util::GMP back end, are a set of modules for number theory in Perl, with a large overlap of functionality with

  • Commented on The CPAN new dist a month contest
    I like these, but I wish we would have as many drives to fix open CPAN issues, especially in core or heavily-used modules. I use a lot of modules that have open defects with submitted patches that just sit there....
  • Commented on The 2013 White Camels
    As someone new to going to YAPC's, I want to also say a big congrats to Wendy, Liz, and the Brasilian Perl community. You deserve the recognition, and I hope you see you this summer!...
  • Commented on Wikipedia linking to CPAN
    From the blog: "[...]it would be also interesting to see subjects in Wikipedia that have implementations in Perl and linking to that implementation." The last time I tried that, someone removed *all* the implementation links claiming "Wikipedia is not a...
  • Commented on Rakudo and NQP Internals Workshop (14/15 Sep)
    Very cool indeed. Wish I could come....
Subscribe to feed Recent Actions from Dana Jacobsen

  • Nick Wellnhofer commented on Stop Putting AUTO_INCREMENT IDs in URLs

    I agree with Dana. Simply use a toy cipher like SKIP32, for example. I'm pretty sure YouTube uses something similar for their video ids.

  • Peter Rabbitson commented on Alternatives to rand()

    Thanks for the explanation. I did not realize the difference in speed can be that wide: I thought all of the kernel-side PRNGs are at around 20MiB/s which was in line with most of your measurements.

  • 3ee5cf54-f022-4a71-8666-3c2b5ee231dd [openid.stackexchange.com] commented on Alternatives to rand()
    The only downside is the slow performance, which is typical of the AES-CTR algorithm.

    It shouldn't be on semi-recent hardware (which has AES support). On my not-so-recent box, openssl speed -evp chacha20 gets 1.6GB/sec with big blocks, but … -evp aes-128-ctr gets 5.1GB/sec. Even aes-256-ctr gets 3.6GB/sec.

    I'm not sure those are the exact right EVP arguments to give it to test, but the presence of dedicated AES hardware makes AES the fastest option, almost always.

  • Yuki Kimoto commented on Alternatives to rand()

    This comparison is very easy to understand.

  • lowjoe commented on Alternatives to rand()

    Math::Random::MTwist is now only available from Backpan. It disappeared without any notice.

Subscribe to feed Responses to Comments from Dana Jacobsen

About blogs.perl.org

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