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

Update to rules_js 1.6.4 to pick up fs patches performance fixes #7

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gregmagolan
Copy link

@gregmagolan gregmagolan commented Oct 31, 2022

//:thing_test                                                            PASSED in 5.1s

to

//:thing_test                                                            PASSED in 1.6s

Also updates to rules_ts rc5 and Bazel 6.0.0rc1

@gregmagolan
Copy link
Author

gregmagolan commented Oct 31, 2022

Some more metrics here,

Pure jest outside of Bazel 1.0s (with the .ts files manually pre-transpiled to js):

$ time pnpm jest
Browserslist: caniuse-lite is outdated. Please run:
  npx browserslist@latest --update-db
  Why you should do it regularly: https:/browserslist/browserslist#browsers-data-updating
  console.log
    [ 2, 3, 4 ]

      at log (thing.js:10:11)

 PASS  ./thing.spec.js
  ✓ a (16 ms)

Test Suites: 1 passed, 1 total
Tests:       1 passed, 1 total
Snapshots:   0 total
Time:        0.281 s, estimated 1 s
Ran all test suites.

real	0m1.064s

With rules_js v.1.6.3 and fs-patches disabled: 1.5s

jest_test(
    name = "thing_test",
    config = ":jest_config",
    data = [
        ":thing_test_src",
    ],
    patch_node_fs = False,
)

With rules_js v.1.6.3 and fs-patches and no sandboxing: 1.3s

jest_test(
    name = "thing_test",
    config = ":jest_config",
    data = [
        ":thing_test_src",
    ],
    patch_node_fs = False,
    tags = ["local"],
)

@gregmagolan
Copy link
Author

@jbedard So looks another 1s of overhead due to the fs patches which we need to workout. I figure there will be some overhead with these patches but we should minimize it as much as possible.

@gregmagolan
Copy link
Author

@jbedard We're down to 1.6s now with Bazel 6.0.0rc1 and rules_js v1.6.4 with your last per fix included in that release.

//:thing_test                                                            PASSED in 1.6s

Still a bit slower than no patches which I measured at 1.2s

//:thing_test                                                            PASSED in 1.2s

With patches on and sandbox disabled I measured 1.4.s

//:thing_test                                                            PASSED in 1.4s

With patches off and no-sandbox I measured 1.1s

//:thing_test                                                            PASSED in 1.1s

@gregmagolan gregmagolan changed the title Update to rules_js 1.6.3 to pick up fs patches performance fixes Update to rules_js 1.6.4 to pick up fs patches performance fixes Nov 2, 2022
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

Successfully merging this pull request may close these issues.

1 participant