Tag: v8

Rubyracer(Ruby的V8绑定)执行速度非常慢

因此,我在eventmachine中有一个TCP服务器,而therubyracer用作预先挂起服务器操作(如filter或扩展)的方法。 当服务器没有接收到大量数据时,这一切都很有吸引力,但是当它被淹没时(有时需要它)它变得非常慢。 所以,我做了一个小基准来看看rubyracer与Ruby相比有多慢,当我看到结果时我感到震惊 : user system total real V8: 0.060000 0.000000 0.060000 ( 0.059903) Ruby: 0.000000 0.000000 0.000000 ( 0.000524) 我不介意它是否很慢,说实话,但我不希望它锁定我的整个服务器,直到它完成处理数据。 使用EM::defer并不是一个真正的选择(我试过它,但它有时会产生大量的线程,具体取决于洪水的密集程度)。 我无法绕过洪水,因为我没有设计协议,客户端要求它们就像那样(尽管很可怕)。 基准代码: require ‘v8’ require ‘benchmark’ class User def initialize @name = “smack” @sex = “female” @age = rand(100) @health = rand(100) @level = rand(100) @colour = rand(14) end attr_accessor :name, :sex, :age, […]

使用therubyracer在Windows机器上安装ruby gem less-rails

我有一段时间试图在我的windows7机器上安装less-rails gem。 我已经设法使用这个二进制文件安装所需的therubyracer.gem: https : //github.com/stereobooster/therubyracer/downloads 我还下载了v8.dll并放入我的ruby / bin目录。 到目前为止一切运行良好,捆绑安装正在运行,服务器启动没有任何问题。 但是,只要我使用较少的文件请求页面,我就会收到以下错误消息 未定义的方法`in_javascript?’ for#“ 我的css.file是空的 /* *= require ‘custom_less/custom’ *= require ‘jquery-ui-1.8.24.custom’ */ custom.css.less看起来像这样 @import “twitter/bootstrap/reset”; @import “twitter/bootstrap/variables”; @import “custom_less/variables”; // Your own variable overrides. @import “twitter/bootstrap/mixins”; @import “custom_less/mixins”; // Your own mixin. @import “twitter/bootstrap/scaffolding”; @import “twitter/bootstrap/grid”; @import “twitter/bootstrap/layouts”; //import of further bootstrap components //but nothing […]