robrich / orchestrator

A module for sequencing and executing tasks and dependencies in maximum concurrency
MIT License
1.23k stars 58 forks source link

Oddity with task durations #14

Open yocontra opened 10 years ago

yocontra commented 10 years ago

When I fire off tasks like this

gulp.run 'coffee', 'stylus', 'jade', 'html', 'images', 'vendor-css', 'vendor-js', 'vendor-fonts', 'server'

My task durations come back like this:

[gulp] Finished 'vendor-fonts' in 4.17 s
[gulp] Finished 'stylus' in 4.18 s
[gulp] Finished 'html' in 4.17 s
[gulp] Finished 'vendor-css' in 4.17 s
[gulp] Finished 'vendor-js' in 4.17 s
[gulp] Finished 'jade' in 4.18 s
[gulp] Finished 'images' in 4.18 s
[gulp] Finished 'coffee' in 4.18 s

Why's that? It seems like the tasks are being executed synchronously. This may be because uglify is blocking the main thread for ~4 seconds. We should figure out a way to show the correct durations in a case like this.

There are no dependencies between any plugins and they all return a stream

robrich commented 10 years ago

Interesting. We launched all the tasks, they were all async, none had dependencies, and all of them waited for one thread hog. How would we know which one burned the CPU and for how long?

yocontra commented 10 years ago

@robrich You know we might be able to mark tasks as parallel and spin them out into a thread (threads-a-go-go) if we wanted to be overlycomplex

robrich commented 10 years ago

Intriguing idea, but incredibly complex.

robrich commented 10 years ago

Seems identical to #23