Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Perl performance just gets better and better!

by vkon (Curate)
on Dec 23, 2011 at 12:03 UTC ( [id://944910]=note: print w/replies, xml ) Need Help??


in reply to Perl performance just gets better and better!

rewriting well tested C library to pure Perl for the sake of being pure Perl is just wrong idea, waste of resources etc.

but - even worse - discussing performance right at this moment.
Mind to show us numbers that compare the speed of original DB against your newly created version? Same question for the memory consumption?

I have no doubts that moving from BerkeleyDB is correct decision.
But reinventing another DB - is very very questionable, to say the least.

Excuse me for being straight,
but the base idea just doesn't feels right to me.

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

Replies are listed 'Best First'.
Re^2: Perl performance just gets better and better!
by flexvault (Monsignor) on Dec 23, 2011 at 18:24 UTC

      Excuse me for being straight, but the base idea just doesn't feels right to me.
    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):

    • redistribution of software, even if you don't charge for it...
    • commercial use of BerkeleyDB...

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

      Mind to show us numbers that compare the speed of original DB against your newly created version?

    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

      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

      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.

Re^2: Perl performance just gets better and better!
by Anonymous Monk on Dec 23, 2011 at 12:05 UTC

    I have no doubts that moving from BerkeleyDB is correct decision.

    Why?

      in a sence - if they had some problems with BerkeleyDB - whatever these are (without deepening into details), so when then they decided to move from BerkeleyDB - then - it could be argued.

      However - I have no strong opinion here. I though BerkeleyDB is a bit outdated - but maybe I am wrong - then I will stay corrected!

        Watch this :)

        me: I have no doubts moving away from BerkeleyDB was a mistake.

        you: Why?

        me: Well they ran into some problems with BerkeleyDB, whatever these are, so they decided to reinvent BerkeleyDB in pure-perl, so they won't depend on BerkeleyDB anymore

        However, I have no strong opinion here, though I feel BerkeleyDB, being updated every few months, is a bit outdated - maybe I'm wrong.

        See how persuasive that is?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://944910]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (5)
As of 2024-04-19 15:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found