如何改进这种rails规范套件? (给出的分析)

时间:2014-04-27 23:21:20

标签: ruby-on-rails ruby performance

Rails 3.2.16项目运行ruby 1.9.3。我已经分析了测试套件,并从这些数字开始:

5531  31.0%  31.0%     5537  31.0% SQLite3::Statement#step
3099  17.4%  48.3%     3099  17.4% garbage_collector
2294  12.9%  61.2%     2294  12.9% BCrypt::Engine.__bc_crypt
2042  11.4%  72.6%     2042  11.4% IO.select

所以我读过关于GC调整(http://labs.clio.com/tuning-ruby-garbage-collection-for-rspec/)并得到了这个数字:

5649  36.6%  36.6%     5655  36.7% sqlite3::statement#step
2284  14.8%  51.4%     2284  14.8% bcrypt::engine.__bc_crypt
2039  13.2%  64.6%     2039  13.2% io.select

现在罪魁祸首是bcrypt ..解决方案(http://collectiveidea.com/blog/archives/2012/11/12/tests-oddly-slow-might-be-bcrypt/)。现在我有:

5971  42.7%  42.7%     5978  42.7% SQLite3::Statement#step
2058  14.7%  57.4%     2058  14.7% IO.select
 724   5.2%  62.5%      724   5.2% garbage_collector

整体情况好多了......但我想要更多!

¿有关SQLite3 :: Statement#step或IO.select要做的事情吗?

0 个答案:

没有答案