作者ireullin (raison detre)
看板Ruby
标题[问题] development时webrick很慢
时间Wed Feb 4 15:00:52 2015
我在development开发时webrick每开启一个网页都很慢
但是布署到production时就没有这样问题了
我目前推测是因为我的js数量太多
特别是amchart这个library的数量
但是由於production时rails本身提供的一些机制 precompile等
所以不会有这样的问题
请问是否有建议的方式可以改善我在开发时候的效能
以下是我执行时期的一些log
Started GET "/assets/amcharts/lang/pl.js?body=1" for 127.0.0.1 at 2015-02-04
14:52:46 +0800
Started GET "/assets/amcharts/lang/pt.js?body=1" for 127.0.0.1 at 2015-02-04
14:52:46 +0800
Started GET "/assets/amcharts/lang/ro.js?body=1" for 127.0.0.1 at 2015-02-04
14:52:46 +0800
Started GET "/assets/amcharts/lang/ru.js?body=1" for 127.0.0.1 at 2015-02-04
14:52:47 +0800
Started GET "/assets/amcharts/lang/rw.js?body=1" for 127.0.0.1 at 2015-02-04
14:52:47 +0800
Started GET "/assets/amcharts/lang/sk.js?body=1" for 127.0.0.1 at 2015-02-04
14:52:47 +0800
Started GET "/assets/amcharts/lang/so.js?body=1" for 127.0.0.1 at 2015-02-04
14:52:48 +0800
Started GET "/assets/amcharts/lang/th.js?body=1" for 127.0.0.1 at 2015-02-04
14:52:48 +0800
Started GET "/assets/amcharts/lang/tr.js?body=1" for 127.0.0.1 at 2015-02-04
14:52:48 +0800
Started GET "/assets/amcharts/pie.js?body=1" for 127.0.0.1 at 2015-02-04
14:52:49 +0800
Started GET "/assets/amcharts/radar.js?body=1" for 127.0.0.1 at 2015-02-04
14:52:49 +0800
Started GET "/assets/amcharts/serial.js?body=1" for 127.0.0.1 at 2015-02-04
14:52:49 +0800
Started GET "/assets/amcharts/themes/black.js?body=1" for 127.0.0.1 at
2015-02-04 14:52:50 +0800
Started GET "/assets/amcharts/themes/chalk.js?body=1" for 127.0.0.1 at
2015-02-04 14:52:50 +0800
Started GET "/assets/amcharts/themes/dark.js?body=1" for 127.0.0.1 at
2015-02-04 14:52:50 +0800
Started GET "/assets/amcharts/themes/light.js?body=1" for 127.0.0.1 at
2015-02-04 14:52:50 +0800
Started GET "/assets/amcharts/themes/patterns.js?body=1" for 127.0.0.1 at
2015-02-04 14:52:51 +0800
Started GET "/assets/amcharts/xy.js?body=1" for 127.0.0.1 at 2015-02-04
14:52:51 +0800
Started GET "/assets/fancybox/jquery.fancybox.js?body=1" for 127.0.0.1 at
2015-02-04 14:52:51 +0800
Started GET "/assets/fancybox/jquery.fancybox.pack.js?body=1" for 127.0.0.1
at 2015-02-04 14:52:52 +0800
Started GET "/assets/jquery.cookie.js?body=1" for 127.0.0.1 at 2015-02-04
14:52:52 +0800
Started GET "/assets/jquery.mousewheel-3.0.6.pack.js?body=1" for 127.0.0.1 at
2015-02-04 14:52:52 +0800
Started GET "/assets/jquery.transit.js?body=1" for 127.0.0.1 at 2015-02-04
14:52:53 +0800
Started GET "/assets/list.js?body=1" for 127.0.0.1 at 2015-02-04 14:52:53
+0800
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 111.250.12.50
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/Ruby/M.1423033255.A.E4C.html
1F:推 mars90226: 可以试试看其他server如unicorn/thin等 02/04 18:39
2F:→ mars90226: 我自己在Windows上是用thin 02/04 18:39
3F:→ ihower: 试试 passenger standalone 装好打 passenger start 即可 02/04 20:26
4F:→ guanting886: 你的assets js 的部分 少用 require_tree . 02/05 02:55
5F:→ guanting886: 引入会用到东西就好 02/05 02:55
6F:→ hSATAC: 除了 assets 以外 Rack::Lock 这层 middleware 我觉得也 02/12 11:43
7F:→ hSATAC: 差满多的 02/12 11:43
8F:→ ireullin: 谢谢大家的意见,正在逐一尝试中 02/17 11:35