当我尝试使用groupdategem用Chartkick gem显示图表时,对于只有3行的表来说,速度非常慢。这是从控制台发出的。加载页面需要22秒!
Tracking Load (1.0ms) SELECT "trackings".* FROM "trackings" WHERE "trackings"."user_id" = $1 AND "trackings"."tracking_category_id" = $2 [["user_id", 1], ["tracking_category_id", 5]]
Rendered trackings/new.haml within layouts/application (22045.5ms)
当我注释掉=javascript_include_tag "//www.google.com/jsapi"
时,它加载得非常快(尽管有一个错误)。
=javascript_include_tag "//www.google.com/jsapi"
=javascript_include_tag "chartkick"
HTML
<script src="//www.google.com/jsapi"></script>
<script src="/assets/chartkick.self-767a86f502825bd83be8240c9952f03a972f3c42d4c4ccfdb42b6070c5348479.js?body=1"></script>
<h1>Track My Progress</h1>
https://github.com/ankane/chartkick#installation
我可以通过对协议进行硬编码来加快速度,但我仍然不知道为什么速度慢。它认为是文件路径还是其他什么?
=javascript_include_tag "https://www.google.com/jsapi"