Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Chriscbr
Copy link
Contributor

Closes #6540

The main thrust of the change in this PR is to reduce the time spent re-bundling inflight JavaScript code with esbuild. To do that, we take a rough heuristic that most of the time, if none of the files that go into a bundle have changed, then the bundle doesn't need to be regenerated. There are technically some edge cases where this may not be the case, but the heuristic should be accurate enough to handle most local iteration scenarios.

  • Update cloud.Function simulation to track which files are produced by the esbuild bundle, and consult against the file's timestamps when the resource is choosing its update plan
  • Update wingc to avoid re-writing files that haven't changed

Checklist

  • Title matches Winglang's style guide
  • Description explains motivation and solution
  • Tests added (always)
  • Docs updated (only required for features)
  • Added pr/e2e-full label if this feature requires end-to-end testing

By submitting this pull request, I confirm that my contribution is made under the terms of the Wing Cloud Contribution License.

@Chriscbr Chriscbr requested a review from a team as a code owner May 28, 2024 18:14
@Chriscbr Chriscbr requested a review from eladb May 28, 2024 18:15
@github-actions
Copy link

Thanks for opening this pull request! 🎉
Please consult the contributing guidelines for details on how to contribute to this project.
If you need any assistance, don't hesitate to ping the relevant owner over Discord.

Topic Owner
Wing SDK and utility APIs @chriscbr
Wing Console @ainvoner, @skyrpex, @polamoros
JSON, structs, primitives and collections @hasanaburayyan
Platforms and plugins @hasanaburayyan
Frontend resources (website, react, etc) @tsuf239
Language design @chriscbr
VSCode extension and language server @markmcculloh
Compiler architecture, inflights, lifting @yoav-steinberg
Wing Testing Framework @tsuf239
Wing CLI @markmcculloh
Build system, dev environment, releases @markmcculloh
Library Ecosystem @chriscbr
Documentation @hasanaburayyan
SDK test suite @tsuf239
Examples @hasanaburayyan
Wing Playground @eladcon

@monadabot
Copy link
Contributor

monadabot commented May 28, 2024

Console preview environment is available at https://wing-console-pr-6577.fly.dev 🚀

Last Updated (UTC) 2024-05-28 19:49

@monadabot
Copy link
Contributor

monadabot commented May 28, 2024

Benchmarks

Comparison to Baseline 🟥⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜
Benchmark Before After Change
version 56ms±0.55 58ms±0.46 +3ms (+4.81%)🟥
functions_10.test.w -t sim 495ms±28.65 501ms±9.51 +6ms (+1.22%)⬜
functions_10.test.w -t tf-aws 2013ms±17.26 2063ms±13.51 +49ms (+2.45%)⬜
hello_world.test.w -t sim 397ms±4.22 403ms±6.75 +6ms (+1.48%)⬜
hello_world.test.w -t tf-aws 1427ms±7.38 1443ms±8.23 +17ms (+1.18%)⬜
functions_1.test.w -t sim 391ms±3.77 399ms±4.77 +8ms (+2.16%)⬜
functions_1.test.w -t tf-aws 811ms±3.56 820ms±6.45 +9ms (+1.09%)⬜
jsii_big.test.w -t sim 2776ms±12.6 2784ms±16.82 +7ms (+0.26%)⬜
jsii_big.test.w -t tf-aws 3006ms±14.01 2990ms±7.68 -16ms (-0.52%)⬜
empty.test.w -t sim 364ms±3.86 366ms±5.04 +2ms (+0.55%)⬜
empty.test.w -t tf-aws 602ms±4.76 597ms±2.84 -6ms (-0.92%)⬜
jsii_small.test.w -t sim 377ms±2.15 375ms±4.43 -2ms (-0.41%)⬜
jsii_small.test.w -t tf-aws 614ms±5.29 615ms±6.91 +0ms (+0.04%)⬜

⬜ Within 1.5 standard deviations
🟩 Faster, Above 1.5 standard deviations
🟥 Slower, Above 1.5 standard deviations

Benchmarks may vary outside of normal expectations, especially when running in GitHub Actions CI.

Results
name mean min max moe sd
version 58ms 57ms 59ms 0ms 1ms
functions_10.test.w -t sim 501ms 485ms 524ms 10ms 13ms
functions_10.test.w -t tf-aws 2063ms 2032ms 2100ms 14ms 19ms
hello_world.test.w -t sim 403ms 390ms 423ms 7ms 9ms
hello_world.test.w -t tf-aws 1443ms 1431ms 1470ms 8ms 12ms
functions_1.test.w -t sim 399ms 389ms 408ms 5ms 7ms
functions_1.test.w -t tf-aws 820ms 807ms 830ms 6ms 9ms
jsii_big.test.w -t sim 2784ms 2759ms 2834ms 17ms 24ms
jsii_big.test.w -t tf-aws 2990ms 2976ms 3012ms 8ms 11ms
empty.test.w -t sim 366ms 351ms 375ms 5ms 7ms
empty.test.w -t tf-aws 597ms 591ms 602ms 3ms 4ms
jsii_small.test.w -t sim 375ms 366ms 385ms 4ms 6ms
jsii_small.test.w -t tf-aws 615ms 602ms 637ms 7ms 10ms
Last Updated (UTC) 2024-05-28 19:54

Copy link
Contributor

@eladb eladb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feels like maybe we need some more test coverage for this?

@mergify
Copy link
Contributor

mergify bot commented May 28, 2024

Thanks for contributing, @Chriscbr! This PR will now be added to the merge queue, or immediately merged if rybickic/iteration-speed is up-to-date with main and the queue is empty.

@mergify mergify bot merged commit c3170e2 into main May 28, 2024
@mergify mergify bot deleted the rybickic/iteration-speed branch May 28, 2024 19:55
@monadabot
Copy link
Contributor

Congrats! 🚀 This was released in Wing 0.74.21.

mergify bot pushed a commit that referenced this pull request Jun 3, 2024
Extends the changes made in #6577 for reducing the time it takes for the simulator to update to cloud.Service and sim.Resource.

## Checklist

- [x] Title matches [Winglang's style guide](https://www.winglang.io/contributing/start-here/pull_requests#how-are-pull-request-titles-formatted)
- [x] Description explains motivation and solution
- [x] Tests added (always)
- [ ] Docs updated (only required for features)
- [ ] Added `pr/e2e-full` label if this feature requires end-to-end testing

*By submitting this pull request, I confirm that my contribution is made under the terms of the [Wing Cloud Contribution License](https://github.com/winglang/wing/blob/main/CONTRIBUTION_LICENSE.md)*.
eladb pushed a commit that referenced this pull request Jun 6, 2024
Extends the changes made in #6577 for reducing the time it takes for the simulator to update to cloud.Service and sim.Resource.

## Checklist

- [x] Title matches [Winglang's style guide](https://www.winglang.io/contributing/start-here/pull_requests#how-are-pull-request-titles-formatted)
- [x] Description explains motivation and solution
- [x] Tests added (always)
- [ ] Docs updated (only required for features)
- [ ] Added `pr/e2e-full` label if this feature requires end-to-end testing

*By submitting this pull request, I confirm that my contribution is made under the terms of the [Wing Cloud Contribution License](https://github.com/winglang/wing/blob/main/CONTRIBUTION_LICENSE.md)*.
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.

Iterations are very slow for bigger projects

4 participants