关于 Truffleruby 的讨论

Has anyone tried having Discourse on the truffleruby?
Does it make sense to look in this direction?

2 个赞

Interesting. Why did they decide to fork not contribute I wonder?

2 个赞

@merefield Truffleruby is an implementation of Ruby for GraalVM by Oracle guys. Good performance and interoperability with other languages on GraalVM.
It’s not a fork.

I have some experience with Rails on Truffleruby and want to check Discourse next week.

Some additional information - Running Rack and Rails Faster with TruffleRuby - Speaker Deck

1 个赞

Sounds fascinating. Would you expect to be able to run the existing Discourse codebase without significant changes? What kind of changes might be needed?

1 个赞

Short answer: No, it currently doesn’t work on TruffleRuby.

5 个赞

@gerhard Thanks for the link, It will be easier for me to understand existing issues.

1 个赞

The current blocker is mini_racer, see https://github.com/oracle/truffleruby/issues/1827

That said, at least all gems install on TruffleRuby, we test that in CI (for some slightly older Discourse).

4 个赞

此问题已于 5 天前修复。

2 个赞

不幸的是,Mastodon 而不是 Discourse 将是第一个在 TruffleRuby 上运行的 :dotted_line_face:

1 个赞

@volanar 是的——我现在没有足够的时间来回答这个问题——白天工作很忙。

1 个赞

@eregon 在这里,我不知道有任何阻碍 truffle 的问题,我们去年合并了 mini racer 的修复程序。

1 个赞

Brandon 一年前让 Discourse 运行起来了:
https://twitter.com/brandonfish/status/1486755128577253376
https://twitter.com/brandonfish/status/1519726230936993792

我记得有一个问题是一些 gem 依赖于 Hash 的线程安全,我们有一个通用的解决方案,但尚未在 TruffleRuby 中合并/集成。另一方面,直接并发使用 Hash 很少是正确的,它通常会以更难找到的方式隐藏并发错误。所以,修复依赖于此的 gem 可能更好,但这需要时间。
我们需要对性能进行基准测试,为了使其有意义/具有代表性,我们应该进行多线程基准测试。这需要 A way to mark C extensions as thread-safe, so they can be executed in parallel · Issue #2136 · truffleruby/truffleruby · GitHub

3 个赞

我希望它能很快得到解决 :face_with_peeking_eye:
您认为使用 truffleruby 后 discourse 的性能指标(TTFB、整体性能等)会有多大改善?

2 个赞

布兰登在这个服务器上吗?

@Matthias_Schuster 快速搜索一下,可以在 Meta 上找到 https://meta.discourse.org/u/bjfish。

2 个赞