rubyspeed:将ruby函数编译为C

时间:2021-01-30 12:46:01
【文件属性】:
文件名称:rubyspeed:将ruby函数编译为C
文件大小:16KB
文件格式:ZIP
更新时间:2021-01-30 12:46:01
ruby c performance compiler CRuby Rubyspeed 工作正在进行中。 欢迎使用Rubyspeed。 现在,Rubyspeed是概念的基本证明(可怕地被一起使用),它允许注释方法声明自动进行专门化并编译为C。这是一个示例: require 'rubyspeed' class TestClass extend ( Rubyspeed :: Compiles ) compile! ( params : [ Rubyspeed :: T . array ( Rubyspeed :: T . int ) , Rubyspeed :: T . array ( Rubyspeed :: T . int ) ] , return_type : Rubyspeed :: T . int ) def self . dot ( a , b ) c = Rubyspeed :: Let . int ( 0 ) a . each_with_index do | a_val , idx | c += a_val * b [ idx ] end c end end 这将
【文件预览】:
rubyspeed-master
----fixtures()
--------example_branch.c(737B)
--------example_dot.c(859B)
--------example_loop.c(776B)
--------example_add.c(583B)
----bench()
--------rubyspeed_bench.rb(874B)
----lib()
--------rubyspeed()
--------inline.rb(11KB)
--------rubyspeed.rb(2KB)
--------.gitignore(66B)
----Gemfile(90B)
----Rakefile(536B)
----test()
--------rubyspeed_test.rb(2KB)
--------rubyspeed()
----README.md(2KB)
----Gemfile.lock(727B)

网友评论