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

Refactor snapshot build #2825

Merged
merged 30 commits into from Sep 2, 2019

Conversation

@ry
Copy link
Collaborator

commented Aug 28, 2019

Depends on #2827

Fixes #2496
Fixes #2711
Fixes #459
Towards #2608
Towards #986

Prototype: https://github.com/ry/deno_typescript

before (master, 65fa2b8) after
build.py deno; from scratch 2m46.347s 2m28.869s
cargo build; from scratch 6m 35s 4m 14s
build.py deno; touch js/util.ts 1m25.620s 0m24.117s
cargo build; touch js/util.ts BROKEN 43.68s

This patch removes the build dependency on Node and rollup and consequently deletes approximately 1 million lines from third_party/node_modules.

A Rust Crate was published with public V8 snapshotting API https://crates.io/crates/deno_typescript

@ry ry changed the title Integrates deno_typescript crate WIP Integrates deno_typescript crate Aug 28, 2019

@ry ry force-pushed the ry:deno_typescript branch 2 times, most recently from c92e9a2 to 473c07f Aug 29, 2019

@ry ry changed the title WIP Integrates deno_typescript crate Refactor snapshot build Aug 30, 2019

Refactor snapshots
Instead of using core/snapshot_creator.rs, instead two crates are
introduced which allow building the snapshot during build.rs.

Rollup is removed and replaced with our own bundler. This removes
the Node build dependency. Modules in //js now use Deno-style imports
with file extensions, rather than Node style extensionless imports.

This improve incremental build time when changes are made //js files by
about 40 seconds.

@ry ry force-pushed the ry:deno_typescript branch from 473c07f to 3a54c03 Aug 30, 2019

ry added 2 commits Aug 30, 2019
@afinch7 afinch7 referenced this pull request Aug 30, 2019
2 of 3 tasks complete
ry added 2 commits Aug 30, 2019

@ry ry requested a review from piscisaureus Aug 30, 2019

@ry ry force-pushed the ry:deno_typescript branch from 04f3f64 to 988370c Aug 30, 2019

@ry ry force-pushed the ry:deno_typescript branch from 988370c to 697139b Aug 30, 2019

ry added 7 commits Aug 30, 2019
if !build.check_only {
build.run("cli:deno_deps");
}
}

This comment has been minimized.

Copy link
@ry

ry Aug 31, 2019

Author Collaborator

Note that cli/build.rs is removed. That means it does not depend on GN during "cargo build"

deps = [
":compiler_bundle",
]
}

This comment has been minimized.

Copy link
@ry

ry Aug 31, 2019

Author Collaborator

Note existing snapshot infrastructure is removed.

@@ -1,231 +0,0 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.

This comment has been minimized.

Copy link
@ry

ry Aug 31, 2019

Author Collaborator

Note that rollup is removed.

ry added 2 commits Aug 31, 2019

@ry ry force-pushed the ry:deno_typescript branch from 316e46a to eef8854 Aug 31, 2019

ry added 2 commits Aug 31, 2019
js/main.ts Show resolved Hide resolved
js/repl.ts Show resolved Hide resolved
js/timers.ts Show resolved Hide resolved
js/util.ts Show resolved Hide resolved
deno_typescript/ops.rs Outdated Show resolved Hide resolved
ry added 2 commits Sep 2, 2019
deno_typescript/ops.rs Outdated Show resolved Hide resolved
deno_typescript/ops.rs Outdated Show resolved Hide resolved
deno_typescript/ops.rs Outdated Show resolved Hide resolved
deno_typescript/lib.rs Outdated Show resolved Hide resolved
ry added 2 commits Sep 2, 2019
@piscisaureus
Copy link
Collaborator

left a comment

LGTM 🌛

@ry ry merged commit d43b43c into denoland:master Sep 2, 2019

3 checks passed

Travis CI - Pull Request Build Passed
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
license/cla Contributor License Agreement is signed.
Details
@ry

This comment has been minimized.

Copy link
Collaborator Author

commented Sep 2, 2019

This patch reduced executable size by 7mb. It had some effect on some of the benchmark's memory usage as well.

Screen Shot 2019-09-02 at 6 11 56 PM

@@ -18,9 +18,9 @@ export interface BuildInfo {
export const build: BuildInfo = {
// These string will be replaced by rollup

This comment has been minimized.

Copy link
@hexagon6

hexagon6 Sep 2, 2019

comment about rollup will be outdated.

@Elemino Elemino referenced this pull request Sep 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
5 participants
You can’t perform that action at this time.