fxpio / composer-asset-plugin

NPM/Bower Dependency Manager for Composer
MIT License
892 stars 156 forks source link

a lot Ram usage in new version #237

Closed jafaripur closed 7 years ago

jafaripur commented 8 years ago

I'm update plugin to latest (Version 1.2) and my composer is version 1.1.3 When updating, in updating asset section, all of my ram used (8GB) and 2 gb get to swp area and my system going to slow mod and i force to restart my computer. I'm use `compuser update`` in fresh installation. more than 80% of ram used by a console which is updating assets by this plugin.

After downgrade the version of plugin to 1.1.4 it's work for me.

francoispluchino commented 8 years ago

What is your configuration of composer.json file?

jafaripur commented 8 years ago
{
    "name": "test/test-platform",
    "type": "project",
    "license": "BSD-3-Clause",
    "minimum-stability": "dev",
    "require": {
        "php": ">=5.4.0",
        "yiisoft/yii2": "*",
        "yiisoft/yii2-bootstrap": "*",
        "yiisoft/yii2-swiftmailer": "*",
        "kartik-v/yii2-widgets": "*",
        "kartik-v/yii2-krajee-base": "*",
        "yiisoft/yii2-redis": "*",
        "mdmsoft/yii2-admin": "*",
        "yiisoft/yii2-mongodb": "*",
        "sheershoff/yii2-module-urlrules": "~1.0.0",
        "bower-asset/fancybox": "@stable",
        "bower-asset/jquery-mousewheel": "@stable",
        "bower-asset/components-font-awesome": "@stable",
        "bower-asset/bootstrap-hover-dropdown": "@stable",
        "bower-asset/slimScroll": "@stable",
        "bower-asset/smooth-scroll": "@stable",
        "bower-asset/jquery.scrollTo": "@stable",
        "bower-asset/bootstrap-sass-official": "@stable",
        "bower-asset/font-awesome": "@stable"
    },
    "require-dev": {
        "yiisoft/yii2-debug": "*",
        "yiisoft/yii2-gii": "*"
    },
    "config": {
        "process-timeout": 1800
    },
    "extra": {
        "asset-installer-paths": {
            "npm-asset-library": "vendor/npm",
            "bower-asset-library": "vendor/bower"
        }
    }
}
francoispluchino commented 8 years ago

You have a Angular JS dependency and it have the nithly versions (-patch). With the 1.2.0 version, I have remove the default pattern to skip version (see #227).

Simply add the asset-pattern-skip-version option in extra section:

{
    "extra": {
        "asset-pattern-skip-version": "(-patch)"
    }
}

At the same time, if you have GIT, you can can force Github Driver to use the native GIT instead of APIs.

{
    "extra": {
        "asset-vcs-driver-options": {
            "github-no-api": true
        }
    }
}

Result: 67.3MB with asset-pattern-skip-version.

schmunk42 commented 8 years ago

See also https://github.com/fxpio/composer-asset-plugin/blob/master/Resources/doc/index.md#use-no-api-option-of-vcs-githhub-driver

Or run composer update -vv to see if there are 100s of tags with a non-excluded schema (eg. dev) which you don't need and which slow down the process.