从 Java 调用 R - RCaller 的更快替代方案

发布于 2024-12-05 02:57:45 字数 204 浏览 2 评论 0原文

我尝试使用 RCaller 2.0 从 Java 调用 R 函数,经过几次尝试后我成功了。集成非常简单,但 RCaller 在运行时有点慢。我担心 RCaller 2.0 不适合我的应用程序,因为我必须重复调用同一脚本数千次,并且该库引入的延迟对于我的需求来说是不可接受的。

是否有更快(就运行时执行时间而言)的替代方案来从 Java 调用 R 脚本?

I tried RCaller 2.0 to call R functions from Java and I managed to make it work after a few tries. Integration was pretty easy but RCaller is kinda slow at runtime. I'm afraid that RCaller 2.0 won't be suitable for my application since I have to repeatedly call the same script thousands of times and the latency introduced by this library is unacceptable for my needs.

Is there a faster (in terms of run-time execution time) alternative for calling R scripts from Java?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

灼痛 2024-12-12 02:57:45

Rcaller 在 2.1 版本中进行了许多性能改进。现在,它支持使用单个 R 进程在循环中将命令传递给 R。也就是说,初始化过程之后不再有系统调用。

Rcaller has many performance improvements that came with the version 2.1. It now supports passing commands to R in a loop using a single R process. That is, there is no more system calls after the initializing process.

深海少女心 2024-12-12 02:57:45

查看 RCaller 源代码树中的测试文件:
https://code.google .com/p/rcaller/source/browse/RCaller/src/test/java/rcaller/RunOnlineTest.java

此测试文件包含在单个 R 进程上运行的顺序命令。据说这种方式很快。

Have a look at the test file in RCaller source tree:
https://code.google.com/p/rcaller/source/browse/RCaller/src/test/java/rcaller/RunOnlineTest.java

This test file includes sequential commands that run on a single R process. This way is said to be fast.

向地狱狂奔 2024-12-12 02:57:45

有什么方法可以将一些迭代推入 R 中,从而减少调用它的频率吗?也许您可以传入一组数据,并运行一组要运行的脚本,现在您可以将它们一一传递。

Is there any way to push some of the iteration over into R, so that you're calling it much less often? Maybe you can pass in an array of data, with an array of scripts to run, where you're passing them in one by one now.

半世晨晓 2024-12-12 02:57:45

尝试 Renjin,至少看起来相当快!

Try Renjin, it seems pretty fast at least!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文