Spea / SpBowerBundle

Symfony2 Bundle to handle asset dependencies with bower
231 stars 44 forks source link

Cache warmup is slow #55

Closed srosato closed 10 years ago

srosato commented 10 years ago

Hi there, I really like the way this bundle eases the integration of bower with Symfony2, but I find it slow when the cache warms up in the dev environment. It takes around 7.5 seconds to warm the cache (according to the profiler) or 4.5 seconds with assetic and install_on_warmup to false while without the bundle it takes me 2.5 seconds from a cleared dev cache. Am I doing something wrong? My current configuration is as follow:

sp_bower:
    bin: %kernel.root_dir%/../node_modules/.bin/bower
    install_on_warmup: true
    assetic:
        nest_dependencies:
            jquery-ui: false
    bundles:
        App:
            asset_dir: ../../public/components

Even with these configurations disabled it is slow

assetic: false
install_on_warmup: false

config_dev.yml:

assetic:
    use_controller: false

because it still needs to create the entire dependency cache

my bower.json:

{
    "name": "ftq",
    "dependencies": {
        "html5shiv": "3.7.0",
        "jquery": "1.8.3",
        "jquery-ui": "1.8.23",
        "bootstrap": "2.3.2"
    },
    "devDependencies": {
        "sinon": "1.7.3",
        "jasmine": "1.3.1",
        "jasmine-jquery": "1.5.9",
        "jasmine-sinon": "0.1.0",
        "karma-jasmine": "0.1.3"
    }
}

Isn't there a way to recreate the dependency mapping when it actually really needs a refresh? Because changing a single parameter information in a config file will recreate the entire dependency map

Spea commented 10 years ago

Hey there, you might want to take a look at issue #54

I recently made an adjustment so the cache will no longer be warmed up when you are doing a "soft change" (like changing something in the config). Please try the latest dev-master version and let me know if you still have the problem.

tarjei commented 10 years ago

Try setting offline:true for the dev config. Thus you'll at least let Bower use it's local cache.

2013/11/7 Martin Parsiegla notifications@github.com

Hey there, you might want to take a look at issuer #54https://github.com/Spea/SpBowerBundle/issues/54

I recently made an adjustment so the cache will no longer be warmed up when you are doing a "soft change" (like changing something in the config). Please try the latest dev-master version and let me know if you still have the problem.

— Reply to this email directly or view it on GitHubhttps://github.com/Spea/SpBowerBundle/issues/55#issuecomment-27956076 .


Tarjei Huse Mobil: 920 63 413

srosato commented 10 years ago

Ahh I see, thanks guys, that is way better with the master version. Does not recompile the dependency mapping when making simple changes such as modifying a twig template for instance.