Giter Site home page Giter Site logo

R integration about rcppziggurat HOT 6 CLOSED

eddelbuettel avatar eddelbuettel commented on June 2, 2024
R integration

from rcppziggurat.

Comments (6)

rstub avatar rstub commented on June 2, 2024 1

The release has happened some time ago, so I am closing this now.

from rcppziggurat.

eddelbuettel avatar eddelbuettel commented on June 2, 2024

It's been a while since I tried this. I think it used to work, and I am wondering if the function registration now gets in the way...

from rcppziggurat.

eddelbuettel avatar eddelbuettel commented on June 2, 2024

And indeed it still works with version 0.1.2 (random pick I made).

And I see user_norm_rand in the shared library when I call nm on it. R calls this directly, so I am not sure how we get in the way, but we do.

Let me ponder this.

from rcppziggurat.

eddelbuettel avatar eddelbuettel commented on June 2, 2024

It is missing in the registration setup. I think I can fix that -- good catch!

from rcppziggurat.

rstub avatar rstub commented on June 2, 2024

I have only now been able to test your patch edfbfc2. The R integration is working fine, which is why I am closing this issue. Unfortunately the speed increase is not as impressive as with zrnormR or zrnorm:

library(RcppZiggurat)
is.loaded("user_norm_rand")
#> [1] TRUE
system.time(rnorm(10^8))
#>        User      System verstrichen 
#>       6.040       0.124       6.165
system.time(zrnormR(10^8))
#>        User      System verstrichen 
#>       1.104       0.120       1.223
system.time(zrnorm(10^8))
#>        User      System verstrichen 
#>       0.656       0.128       0.782
RNGkind(normal.kind = "user")
system.time(rnorm(10^8))
#>        User      System verstrichen 
#>       3.132       0.132       3.263

from rcppziggurat.

eddelbuettel avatar eddelbuettel commented on June 2, 2024

Thank you for that too! I had been meaning to circle back to you.

I think I did the same / similar benchmark test when I first cooked this up and was similarly disappointed. Thinking about a little I realized that ... this is likely due to the overhead from R's state keeping which is much more involved than what we do here with Ziggurat. Still a gain though...

I re-opened just to remind myself to release this. I need one more pass over the vignette, not sure when I get to that. I could drop the package into a drat repo if that helped you, but you seem fine with GitHub installation too :)

Gruesse aus Chicago.

from rcppziggurat.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.