middleman / middleman-sprockets

Sprockets support for Middleman
http://middlemanapp.com
MIT License
62 stars 53 forks source link

Slow refresh of page after a file it edited. #104

Closed iwarner closed 8 years ago

iwarner commented 8 years ago

Guys

I know this has been stated a few times, but as my project grows I am running into a constant battle of the reload being extremely poor

I am still using sprockets but recently added the sassc not much happened I think

I do use a few sprockets appends sprockets.append_path File.join( root, "bower_components" ) sprockets.append_path File.join( root, "source/atom" ) sprockets.append_path File.join( root, "source/molecule" ) sprockets.append_path File.join( root, "source/organism" ) sprockets.append_path File.join( root, "source/template" ) sprockets.append_path File.join( root, "source/page" )

Which could be an issue?

Anyway if I can ask if you can benchmark my project : https://github.com/iwarner/CodeBlender-Middleman

It could help with your development also?

This is the Gist of my middlemen preview server verbose https://gist.github.com/iwarner/2783130afe18d2a876f6

Main pause is at line 1170 Just before it starts the server - [2016-03-24 12:14:26] INFO WEBrick 1.3.1

Gems installed middleman (4.1.4) middleman-cli (4.1.4) middleman-core (4.1.4) middleman-favicon-maker (4.0.3) middleman-livereload (3.4.6) middleman-minify-html (3.4.1) middleman-syntax (2.1.0)

I always use : "bundle exec middleman server" to initiate

Many thanks

stevenosloan commented 8 years ago

@iwarner would be great if you could take a look at it now -- turns out my "fix" for the tests wasn't necessary in reality, I just had to ensure the tests were touching files for sprockets to pick them up.

So after (non-sprockets) file changes you should see quick renders of sprockets stuff, but if the app reloads (like if you change config.rb) it's cache does get reset so it'll be a full boot time again.

iwarner commented 8 years ago

@stevenosloan I am all over this no problem :+1:

iwarner commented 8 years ago

Ok initial results are amazing : changed a SCSS and this time only CSS get updated

== Instrument (sprockets.asset_lookup): 3303.404ms {:asset=>#} == Instrument (sprockets): 3303.727ms {:name=>"process_resource", :resource=>#} == Instrument (sprockets): 3309.325ms {:name=>"manipulator.sprockets_resources"} == Instrument (sitemap.manipulator): 3310.1ms {:name=>:sprockets} == Instrument (sitemap.update): 3333.848ms {:reasons=>[:touched_file]} == Instrument (builder.output.resource.render-template): 598.775ms {:path=>"index.html.haml"} == Instrument (builder.output.resource.render-layout): 371.013ms {:path=>"fullWidth.haml"}

JS - Super quick

= Instrument (sprockets.asset_lookup): 277.853ms {:asset=>#} == Instrument (sprockets): 278.33299999999997ms {:name=>"process_resource", :resource=>#} == Instrument (sprockets): 287.49ms {:name=>"manipulator.sprockets_resources"} == Instrument (sitemap.manipulator): 288.18899999999996ms {:name=>:sprockets} == Instrument (sitemap.update): 307.095ms {:reasons=>[:touched_file]}

I can now put the livereload back on :)

stevenosloan commented 8 years ago

Sweet! I should have been a bit more diligent testing before killing that cache.

Let me know if you run into anything else, thanks for being so helpful.

iwarner commented 8 years ago

@stevenosloan no, thank you - really speedy fix, reason i like middleman is that you guys rock.

Trying to give something back by exposing all my partials etc : http://codeblender.net/ - one day someone might find it useful but still work in progress, but I use for Prototyping more complex projects.