AJP*_*AJP 5 javascript performance ruby-on-rails pre-compilation
运行:
bundle exec rake assets:precompile RAILS_ENV=production
Run Code Online (Sandbox Code Playgroud)
大约250kb的15个.js文件需要大约6分钟.它不应该花这么长时间吗?我看到"Microsoft基于控制台的脚本主机"在大部分时间里都处于平稳状态.
人们推荐/知道什么是可能的?有没有办法用Ruby-Racer或其他javascript V8引擎实现替换它?或者找出我的代码中导致时间长的问题?或者是其他东西?
小智 1
您正在运行哪个服务器?是 Ubuntu、Debian、Mac 吗?确保你的 Gemfile 中有这个:
group :production do
gem "libv8"
gem "therubyracer", :require => 'v8'
end
Run Code Online (Sandbox Code Playgroud)
有关更多信息,请参阅此页面: https ://github.com/rails/rails/issues/2537
您还可以尝试删除app/assets/*文件夹中未使用的文件。时间大部分花在JS编译上。