New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Performance for large projects -> improved ten times! #504
Comments
Devastating because, people coming with their existing rails apps to ruby-hyperloop, just including the hyperloop gem, experience page load times of 40 seconds, just because they have several asset_tags in their app. |
hmm, are you sure this is the right place? I can't simulate it, this method is called only on compiled files in 'public/assets/' directory during assets:precompile and only once for each file, so it should be fine |
I am sure its not the right place, the monkey above is just to express what i mean and to allow others to verify my finding with opal-rails or ruby-hyperloop. Please, in your rails app, do a Its not javascript assets from public/assets, its full fledged ruby in the browser during development for serious front end development in rails development environment, where page load times in double digits are painful |
@janbiedermann thanks, but instead of caching, calling these stats should be avoided the problem is that this peace of code calls file stats (for the whole structure) if path doesn't contain '/' here's the second case It looks like sprockets 4 has a better resolver, but I didn't have a chance to test it because of compatibility issues. |
@ahorek that would be just perfect, if those calls could be avoided, i just don't understand sprockets that well to find to right place, so thanks for pointing me there. I don't know what bower is, but i will tinker with resolve.rb#L155 and sprockets 4. |
if i have to cache the cache to get at least a little bit performance, then something is wrong with the cache, isn't it? |
design issues:
Alternatives provided in PR #525 |
i got a opal-webpack-loader instead |
ruby-hyperloop.org project uses rails with opal-rails, opal being ruby for browsers then makes the complete ruby load_path the asset path for sprockets. In rails development environment then sprockets checks with File.fstat the whole asset path/ruby load_path, thousands of files on each request or javascript_include_tag resulting in devastating response times.
sprockets should have a configurable option, to specify the directory or directories on which it should check for changed files and cache the File.stat for files outside of those directories. Example monkey provided below.
Numbers: for simple page get with sprockets 3.7.1 around 4 seconds
With monkey patch provided below around 480ms
(including #503 )
monkey patch:
sprockets-3.7.1/lib/sprockets/path_utils.rb
The text was updated successfully, but these errors were encountered: