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

perf: avoid large array concatenation #1883

Merged
merged 1 commit into from
Aug 27, 2024

Conversation

jbedard
Copy link
Member

@jbedard jbedard commented Aug 9, 2024

Avoid doing the same + operations multiple times and use += instead of .extends to avoid the starlark method invocation.


Changes are visible to end-users: no

Test plan

  • Covered by existing test cases

@jbedard jbedard force-pushed the perf-reduce-array-concat branch 2 times, most recently from 779c8cf to da7c264 Compare August 9, 2024 03:17
@jbedard jbedard force-pushed the perf-reduce-array-concat branch 2 times, most recently from 6934952 to 7d18014 Compare August 21, 2024 19:43
Copy link

aspect-workflows bot commented Aug 21, 2024

Test

All tests were cache hits

193 tests (100.0%) were fully cached saving 47s.


Test

e2e/bzlmod

All tests were cache hits

5 tests (100.0%) were fully cached saving 631ms.


Test

e2e/gyp_no_install_script

All tests were cache hits

2 tests (100.0%) were fully cached saving 516ms.


Test

e2e/js_image_oci

All tests were cache hits

1 test (100.0%) was fully cached saving 6s.


Test

e2e/npm_link_package

All tests were cache hits

3 tests (100.0%) were fully cached saving 925ms.


Test

e2e/npm_link_package-esm

All tests were cache hits

3 tests (100.0%) were fully cached saving 925ms.


Test

e2e/npm_translate_lock

All tests were cache hits

1 test (100.0%) was fully cached saving 59ms.


Test

e2e/npm_translate_lock_empty

All tests were cache hits

1 test (100.0%) was fully cached saving 59ms.


Test

e2e/npm_translate_lock_multi

All tests were cache hits

2 tests (100.0%) were fully cached saving 184ms.


Test

e2e/npm_translate_lock_partial_clone

All tests were cache hits

1 test (100.0%) was fully cached saving 55ms.


Test

e2e/npm_translate_lock_replace_packages

All tests were cache hits

3 tests (100.0%) were fully cached saving 770ms.


Test

e2e/npm_translate_lock_subdir_patch

All tests were cache hits

1 test (100.0%) was fully cached saving 167ms.


Test

e2e/npm_translate_package_lock

All tests were cache hits

1 test (100.0%) was fully cached saving 59ms.


Test

e2e/npm_translate_yarn_lock

All tests were cache hits

1 test (100.0%) was fully cached saving 59ms.


Test

e2e/package_json_module

All tests were cache hits

1 test (100.0%) was fully cached saving 507ms.


Test

e2e/pnpm_lockfiles

All tests were cache hits

40 tests (100.0%) were fully cached saving 16s.


Test

e2e/pnpm_workspace

All tests were cache hits

10 tests (100.0%) were fully cached saving 7s.


Test

e2e/pnpm_workspace_rerooted

All tests were cache hits

10 tests (100.0%) were fully cached saving 4s.


Test

e2e/repo_mapping

All tests were cache hits

2 tests (100.0%) were fully cached saving 324ms.


Test

e2e/rules_foo

All tests were cache hits

2 tests (100.0%) were fully cached saving 562ms.


Test

e2e/vendored_node

All tests were cache hits

1 test (100.0%) was fully cached saving 251ms.


Buildifier      Format

@jbedard jbedard force-pushed the perf-reduce-array-concat branch 2 times, most recently from c343d69 to c98ec33 Compare August 21, 2024 20:39
@DavidZbarsky-at
Copy link
Contributor

I couldn't measure a difference on our repo, it's too noisy. I'm sure this doesn't hurt though

@jbedard jbedard force-pushed the perf-reduce-array-concat branch from c98ec33 to 47a6df3 Compare August 23, 2024 18:45
@jbedard jbedard force-pushed the perf-reduce-array-concat branch from 47a6df3 to 54d8f99 Compare August 23, 2024 18:46
@jbedard
Copy link
Member Author

jbedard commented Aug 23, 2024

I think I'll just stick with the diff that we are more certain about for now. We can investigate the method vs operator another time.

@jbedard jbedard requested a review from gregmagolan August 23, 2024 18:46
@jbedard jbedard marked this pull request as ready for review August 23, 2024 18:46
@gregmagolan gregmagolan merged commit 91ac232 into aspect-build:main Aug 27, 2024
67 checks passed
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.

3 participants