Skip to content
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

It should be much faster.. #78

Open
johannesjo opened this issue Aug 11, 2014 · 6 comments
Open

It should be much faster.. #78

johannesjo opened this issue Aug 11, 2014 · 6 comments

Comments

@johannesjo
Copy link

With this little function the watch task is about 3 to 4 times faster, as it is with load-grunt-config:

var loadConfig = function (path, grunt)
{
    var glob = require('glob');
    var object = {};
    var key;

    glob.sync('*', { cwd: path }).forEach(function (option)
    {
        key = option.replace(/\.js$/, '');
        object[key] = require(path + option);
    });

    return object;
};
// ... later
grunt.initConfig(loadConfig('myconfigpath'));

    // jit-grunt
    require('jit-grunt')(grunt, {
        sprite: 'grunt-spritesmith'
    });
@jgallen23
Copy link
Member

I'm not sure I follow... Can you try to explain in more detail?

@SolomoN-ua
Copy link
Collaborator

If you talking about jit-grunt, yes it's much faster then load-grunt-tasks. And if you want, you can use it with load-grunt-config, just take a look into documentation

@johannesjo
Copy link
Author

No I'm already using jit-grunt. Without its even slower. With load-grunt-config the loading-tasks task takes about 1s (using time-grunt). With the method described above it takes about 200-400 miliseconds.

@SolomoN-ua
Copy link
Collaborator

@jgallen23 correct me if I'm wrong, but as I know load-grunt-config uses pretty much the same algorithm inside, only difference is that load-grunt-config is doing little bit more work than just loading tasks.

@johannesjo sorry, but I don't get what is your main point in this issue. :(

@johannesjo johannesjo changed the title Its really slow... It should be much faster.. Aug 12, 2014
@johannesjo
Copy link
Author

@SolomoN-ua The whole point is to show, that the module is way slower than it should be. The modules readconfigdir.js should be rewritten to be as fast, as it could be (only in my humble opinion of course).

Also jit-grunt is much faster.

@SolomoN-ua
Copy link
Collaborator

Hi @johannesjo, can you provide a PR for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants