Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

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

by bliako (Monsignor)
on Nov 10, 2021 at 09:38 UTC ( #11138668=note: print w/replies, xml ) Need Help??


in reply to Anyone with XS experience willing to create a high performance data type for Perl?

#include <ruby.h>

have you really thought that properly?

(for the record: https://github.com/skade/rbtree/blob/master/dict.c )

Unless you can provide a stand-alone rbtree.c, I don't find adding all ruby dependencies a good idea. When you eventually have such C code, use Inline::C to prototype it. The difficult part would be to provide the perl-vars into the C functions. There's documentation and a lot of examples though, so just a matter of time and effort. I am sure you will have something going for scalars at least in short time. And take it from there. See also: Re^3: XS, raspberry pi, and a hundred bucks on how to use Inline::C to bootstrap an XS project. Please post here again when you have something more concrete, and/or msg me.

bw, bliako

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

Replies are listed 'Best First'.
Re^2: Anyone with XS experience willing to create a high performance data type for Perl?
by LanX (Sage) on Nov 10, 2021 at 10:08 UTC
    I think the OP should first show some reproducible benchmarks before jumping to action.

    There have been some new monks lately making bold demands without providing details.

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery

        Hope my spidey-sense is wrong

        You're in luck, it is wrong. :-)

          > Do it as fast in Perl as it is with Ruby/C rbtree, i was unable to.

          Showing us benchmarks, you were also unable to. 🤷🏻‍♂️

          Cheers Rolf
          (addicted to the Perl Programming Language :)
          Wikisyntax for the Monastery

          > There is nothing bold. A red and black tree is always faster.

          Erm . . . Citation needed . . . (channelling my inner Fletch :)

    Re^2: Anyone with XS experience willing to create a high performance data type for Perl?
    by beautyfulman (Sexton) on Nov 11, 2021 at 02:30 UTC

          You are right. In the link I posted, dict.c depends on ruby.h but the link you posted does not, the dependency for ruby.h is now in rbtree.c. (I posted that link as I was lazy, to avoid finding out how to extract source code from gem files). Do you have test code to demonstrate use of dict operations implemented in dict.c?

      Log In?
      Username:
      Password:

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

      How do I use this? | Other CB clients
      Other Users?
      Others having an uproarious good time at the Monastery: (3)
      As of 2022-01-26 22:48 GMT
      Sections?
      Information?
      Find Nodes?
      Leftovers?
        Voting Booth?
        In 2022, my preferred method to securely store passwords is:












        Results (70 votes). Check out past polls.

        Notices?