in reply to Re: Perl performance just gets better and better!
in thread Perl performance just gets better and better!

Because we have a business case!

Since BerkeleyDB is used by all of our products, each year since Oracle bought Sleepycat Software, Inc., we have had an outside counsel review the dual licenses for BerkeleyDB. This year we used a new firm to review, and the outcome was not nice.

Two points (from memory):

But I think you should get your own legal advice! For us those statements and others were alarming!

When I get back to the office after the holidays, I'll put up some real numbers. But in general, our pure-perl DB performs better than expected (Note: my original goal was to get 20% of the BerkeleyDB performace and that would meet our company needs). On fixed length records that are multiples of 8 bytes, our pure-perl DB is +/- 10% of BerkeleyDB. But on random variable length key/value pairs ( 20 to 64 byte keys, and 64 to 768 byte values), we're beating BerkeleyDB by as much as 300%.

Why, because I wrote it to Perl's strengths and not to be a copy of a C program. For example, my first pass used only arrays. When I replaced the arrays with hashes, there was an immediate performance boost. Perl's lookups are much faster than mine. After profiling, 'sort' showed up below 'pack/unpack' on the list of routines. Not worth trying to improve!

And, thanks to some questions from BrowserUk, we can support databases as large as 1024TBytes on 32/64 bit, big/little endian machines.

Thank you

"Well done is better than well said." - Benjamin Franklin

  • Comment on Re^2: Perl performance just gets better and better!

Replies are listed 'Best First'.
Re^3: Perl performance just gets better and better!
by Anonymous Monk on Dec 23, 2011 at 19:28 UTC

    But I think you should get your own legal advice!

    I agree.

    Regarding the license, see Re^12: Change in Berkeley DB in Perl 5.12? , basically, the FAQ says : No. The Berkeley DB license requires that software that uses Berkeley DB be freely redistributable. In the case of Perl, that software is Perl, and not your scripts.

    When SleepyCat changed berkeley-db to be dual-licensed, they kept perl users in mind. Oracle did not change the license.

        When SleepyCat changed berkeley-db to be dual-licensed...

      But now you may be giving legal advice!

      And many changes have taken place since Oracle took over. And Oracle is in charge!

      Your mileage may vary, but better safe than sorry

      Update: Its not just Perl source code -- From Oracle's web site: "The our open source license permits you to use Berkeley DB, Berkeley DB Java Edition or Berkeley DB XML at no charge under the condition that if you use the software in an application you redistribute, the complete source code for your application must be available and freely redistributable under reasonable conditions. If you do not want to release the source code for your application, you may purchase a license from Oracle. For pricing information, or if you have further questions on licensing, please contact us at berkeleydb-info_us@oracle.com."

      Thank you

      "Well done is better than well said." - Benjamin Franklin

        But now you may be giving legal advice!

        No chance! I am not a lawyer :)

Re^3: Perl performance just gets better and better!
by vkon (Curate) on Dec 23, 2011 at 20:30 UTC
    maybe you're right.

    It is hard to believe that you beat Berkeley DB by 300%.
    but - assume that you have good and honest numbers, and indeed you've outbeat the BerkeleyDB.
    It could be that you implemented a subset of DB that suits you and therefore you could win by not implementing some "difficult" places that Berkeley DB must have implemented. I do not know.

    But generally - you do not gain speed by re-implementing robust C library into pure-perl.

    Another point - external C library is safer to use with respect to fact that it is better tested - by larger user base etc.

    Ok, your mileage varies in a sence that you win in your way,
    but generally - this way just does not win.

    Regards,
    Vadim.