Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^3: Anyone with XS experience willing to create a high performance data type for Perl?

by eyepopslikeamosquito (Bishop)
on Nov 11, 2021 at 23:22 UTC ( #11138742=note: print w/replies, xml ) Need Help??


in reply to Re^2: Anyone with XS experience willing to create a high performance data type for Perl?
in thread Anyone with XS experience willing to create a high performance data type for Perl?

> Ideally need a balanced tree like Red Black or AVL, the Perl hash takes 4 seconds

Not surprisingly, the Perl hash, at 4 seconds, is a lot faster than the (pure Perl) Tree::RB, at 33 seconds, when running your (unpublished) benchmark.

Is there any functional reason why you can't just use a hash?

Since you mentioned AVL, have you tried AVLTree from CPAN? It uses a XS wrapper around Julienne Walker's AVL Tree C library, so should be a lot faster than Tree::RB.

References

Disclaimer: I have no experience using any of these, just did a quick google for you.

  • Comment on Re^3: Anyone with XS experience willing to create a high performance data type for Perl?

Replies are listed 'Best First'.
Re^4: Anyone with XS experience willing to create a high performance data type for Perl?
by beautyfulman (Sexton) on Nov 12, 2021 at 01:34 UTC
    I tested that AVL tree, i did not include it in the post b ecause author claims it is unstable not because it was super slow. But anyway it takes 14 seconds. I did not test Tree::BPTree but it is pure Perl, can't do better.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (1)
As of 2022-01-19 01:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (54 votes). Check out past polls.

    Notices?