uProxy-p2p icon indicating copy to clipboard operation
uProxy-p2p copied to clipboard

uproxy-networking build times

Open ryscheng opened this issue 11 years ago • 8 comments

Time to fresh clone: 0m0.580s Time to 'npm install', which also includes the first build: 2m33.389s Time to 'grunt' again, which should trigger fast compile: 1m23.828s

I don't understand why every ts:* target takes 4 seconds, when it isn't compiling anything and reports that it takes 0 seconds. That's false advertising. Plus there's a ton of ts:* targets that get run as part of the default 'grunt' task. Also, I have no ability to Ctrl-C out of the build once I've started.

ryscheng avatar Dec 12 '14 18:12 ryscheng

see: https://github.com/uProxy/uproxy-lib/pull/72 What version of tsc do you have? maybe it's very old and doesn't support the fast compile?

iislucas avatar Dec 12 '14 18:12 iislucas

This should be in the package.json. As I said, this is a fresh clone, so there's no reason I'm not on the correct version. It does support fast compile, because every typescript task says

No file changes were detected. Skipping Compile TypeScript compilation complete: 0.00s for 0 typescript files

But there's a long delay before these tasks even start. Can you please try it and tell me if you see the same behavior?

ryscheng avatar Dec 12 '14 18:12 ryscheng

I see the same behaviour. I can't find any mention of this on grunt-ts' issue tracker. Very annoying, I agree.

trevj avatar Dec 15 '14 16:12 trevj

Same behaviour here as well.

To be clear: tsc says it spent 0.00 seconds performing typescript compilation. That's true, but it takes ~4 seconds to determine that no compilation is necessary.

matthild avatar Dec 15 '14 16:12 matthild

Right. I basically see no speed advantage for uproxy-networking. I don't know it would behave differently from uproxy-lib.

trevj avatar Dec 15 '14 22:12 trevj

So, strace indicates that grunt-ts performs some sort of scan of every file in the current directory on startup.

On my system, it takes 86s for the initial compile; subsequent compiles drop to 70s.

Now, if I prune the node_modules/ directory (cca is the worst offender with almost 10k files -- in total, I reduce from 19k files to 4k) then time for subsequent compiles falls to just 23s.

I've filed an issue with grunt-ts: https://github.com/TypeStrong/grunt-ts/issues/196

trevj avatar Jan 06 '15 22:01 trevj

Argh, nothing to do with grunt-ts.

The problem is with the exclusion glob we're using. Currently it's this:

src: [
  'build/' + name + '/**/*.ts',
  '!**/*.spec.ts',
  '!**/*.d.ts',
]

Without limiting the two exclusion paths to, a complete traversal of the current directory is necessary. I guess I had been thinking they simply filtered the initial search. Not so.

If I change it to this:

src: [
  'build/' + name + '/**/*.ts',
  '!build/' + name + '/**/*.spec.ts',
  '!build/' + name + '/**/*.d.ts',
]

Then the initial compile time drops to 23s and subsequent compile times drop to 3.5s. Umm...oops.

trevj avatar Jan 06 '15 22:01 trevj

yay! I'm glad we figured out the root problem. How far off are we from a pull request?

On Tue, Jan 6, 2015 at 5:58 PM, trevj [email protected] wrote:

Argh, nothing to do with grunt-ts.

The problem is with the exclusion glob we're using. Currently it's this:

src: [ 'build/' + name + '//*.ts', '!/.spec.ts', '!__/.d.ts', ]

Without limiting the two exclusion paths to, a complete traversal of the current directory is necessary. I guess I had been thinking they simply filtered the initial search. Not so.

If I change it to this:

src: [ 'build/' + name + '//*.ts', '!build/' + name + '//.spec.ts', '!build/' + name + '/__/.d.ts', ]

Then the initial compile time drops to 23s and subsequent compile times drop to 3.5s. Umm...oops.

— Reply to this email directly or view it on GitHub https://github.com/uProxy/uproxy/issues/667#issuecomment-68950310.

ryscheng avatar Jan 06 '15 23:01 ryscheng