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

use prehash to avoid rehashing the key in the task cache #8174

Merged
merged 1 commit into from
Jun 3, 2024
Merged

Conversation

sokra
Copy link
Member

@sokra sokra commented May 17, 2024

Description

This avoids hashing the task type multiple times, e. g. for inserting after lookup or on rehashing of the hash map

Testing Instructions

@sokra sokra requested a review from a team as a code owner May 17, 2024 21:37
Copy link

vercel bot commented May 17, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
examples-nonmonorepo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 3, 2024 4:20pm
rust-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 3, 2024 4:20pm
8 Ignored Deployments
Name Status Preview Comments Updated (UTC)
examples-basic-web ⬜️ Ignored (Inspect) Visit Preview Jun 3, 2024 4:20pm
examples-designsystem-docs ⬜️ Ignored (Inspect) Visit Preview Jun 3, 2024 4:20pm
examples-gatsby-web ⬜️ Ignored (Inspect) Visit Preview Jun 3, 2024 4:20pm
examples-kitchensink-blog ⬜️ Ignored (Inspect) Visit Preview Jun 3, 2024 4:20pm
examples-native-web ⬜️ Ignored (Inspect) Visit Preview Jun 3, 2024 4:20pm
examples-svelte-web ⬜️ Ignored (Inspect) Visit Preview Jun 3, 2024 4:20pm
examples-tailwind-web ⬜️ Ignored (Inspect) Visit Preview Jun 3, 2024 4:20pm
examples-vite-web ⬜️ Ignored (Inspect) Visit Preview Jun 3, 2024 4:20pm

Copy link
Contributor

github-actions bot commented May 17, 2024

🟢 Turbopack Benchmark CI successful 🟢

Thanks

Copy link
Contributor

github-actions bot commented May 17, 2024

⚠️ This change may fail to build next-swc.

Logs

error: failed to select a version for `swc_core`.
    ... required by package `turbopack-binding v0.1.0 (https://github.com/vercel/turbo?rev=a66c35a3e395ecddcade4f3c6593a84685abfd98#9503a168)`
    ... which satisfies git dependency `turbopack-binding` (locked to 0.1.0) of package `next-swc-napi v0.0.0 (/root/actions-runner/_work/turbo/turbo/packages/next-swc/crates/napi)`
versions that meet the requirements `^0.92.8` are: 0.92.8

all possible versions conflict with previously selected packages.

  previously selected package `swc_core v0.92.5`
    ... which satisfies dependency `swc_core = "^0.92.5"` (locked to 0.92.5) of package `wasm v0.0.0 (/root/actions-runner/_work/turbo/turbo/packages/next-swc/crates/wasm)`

failed to select a version for `swc_core` which could resolve this conflict

See job summary for details

Copy link
Contributor

github-actions bot commented May 17, 2024

⚠️ CI failed ⚠️

The following steps have failed in CI:

  • Turbopack Rust tests (mac/win, non-blocking)

See workflow summary for details

@sokra sokra requested a review from arlyon May 20, 2024 06:01
@arlyon arlyon requested a review from a team as a code owner May 22, 2024 09:59
@arlyon arlyon requested review from mehulkar and tknickman May 22, 2024 09:59
@arlyon arlyon changed the base branch from main to arlyon/mpl-2-0-copyleft-exception May 22, 2024 09:59
Copy link
Contributor

arlyon commented May 22, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @sokra and the rest of your teammates on Graphite Graphite

Base automatically changed from arlyon/mpl-2-0-copyleft-exception to main May 22, 2024 18:23
arlyon added a commit that referenced this pull request May 22, 2024
### Description

In this PR #8174 the library prehash
is licensed using MPL2.0 (great) but without the copyleft exception.

I believe that we are OK. From what I understand this prevents us from
making and redistributing changes to this library under one of the MPL
secondary licenses ("Secondary License" means either the GNU General
Public License, Version 2.0, the GNU Lesser General Public License,
Version 2.1, the GNU Affero General Public License, Version 3.0, or any
later versions of those licenses).

It does not exclude us from using that library in a 'larger work' that
is licensed using a different (compatible) license so for the purpose of
distributing a binary it is the same as MPL-2.0

### Testing Instructions

N/A
@bgw
Copy link
Member

bgw commented May 22, 2024

See my comment here: #8194 (review)

I don't think this library is providing much value, and we could easily implement this ourselves, which might avoid the mess with the extra MPL license variant.

@tknickman tknickman removed their request for review May 24, 2024 17:26
@mehulkar mehulkar removed their request for review May 30, 2024 00:53
@arlyon arlyon changed the base branch from main to arlyon/prehash-crate May 31, 2024 14:30
Copy link
Contributor

@arlyon arlyon left a comment

Choose a reason for hiding this comment

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

Copy link
Contributor

@arlyon arlyon left a comment

Choose a reason for hiding this comment

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

Downstream done!

@arlyon arlyon merged commit 9503a16 into main Jun 3, 2024
54 of 56 checks passed
@arlyon arlyon deleted the sokra/prehash branch June 3, 2024 16:41
Copy link
Contributor

arlyon commented Jun 3, 2024

Merge activity

kdy1 added a commit to vercel/next.js that referenced this pull request Jun 5, 2024
# Turbopack

* vercel/turborepo#8272 <!-- Donny/강동윤 - feat:
Update `swc_core` to `v0.92.8` -->
* vercel/turborepo#8262 <!-- Alexander Lyon - add
crate to calculate prehashes -->
* vercel/turborepo#8174 <!-- Tobias Koppers - use
prehash to avoid rehashing the key in the task cache -->
* vercel/turborepo#7674 <!-- Alexander Lyon - [turbo
trace] add ability to filter by value and occurences -->
* vercel/turborepo#8287 <!-- Donny/강동윤 - feat:
Update `swc_core` to `v0.92.10` -->
* vercel/turborepo#8037 <!-- Alexander Lyon - create
turbo-static for compile time graph analysis -->
* vercel/turborepo#8293 <!-- Will Binns-Smith - Sync
Cargo.lock with Next.js -->
* vercel/turborepo#8239 <!-- Benjamin Woodruff -
Reduce amount of code generated by ValueDebugFormat -->
* vercel/turborepo#8304 <!-- Benjamin Woodruff -
Minor optimizations to the codegen of TaskFnInputFunction -->
* vercel/turborepo#8221 <!-- Donny/강동윤 - perf:
Introduce `RcStr` -->


### What?

I tried using `Arc<String>` in
vercel/turborepo#7772, but a team member suggested
creating a new type so we can replace underlying implementation easily
in the future.

### Why?

To reduce memory usage.

### How?

Closes PACK-2776
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Jul 25, 2024
…orepo#8174)

### Description

This avoids hashing the task type multiple times, e. g. for inserting
after lookup or on rehashing of the hash map

### Testing Instructions

<!--
  Give a quick description of steps to test your changes.
-->
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Jul 29, 2024
…orepo#8174)

### Description

This avoids hashing the task type multiple times, e. g. for inserting
after lookup or on rehashing of the hash map

### Testing Instructions

<!--
  Give a quick description of steps to test your changes.
-->
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Jul 29, 2024
…orepo#8174)

### Description

This avoids hashing the task type multiple times, e. g. for inserting
after lookup or on rehashing of the hash map

### Testing Instructions

<!--
  Give a quick description of steps to test your changes.
-->
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Aug 1, 2024
…orepo#8174)

### Description

This avoids hashing the task type multiple times, e. g. for inserting
after lookup or on rehashing of the hash map

### Testing Instructions

<!--
  Give a quick description of steps to test your changes.
-->
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Aug 14, 2024
# Turbopack

* vercel/turborepo#8272 <!-- Donny/강동윤 - feat:
Update `swc_core` to `v0.92.8` -->
* vercel/turborepo#8262 <!-- Alexander Lyon - add
crate to calculate prehashes -->
* vercel/turborepo#8174 <!-- Tobias Koppers - use
prehash to avoid rehashing the key in the task cache -->
* vercel/turborepo#7674 <!-- Alexander Lyon - [turbo
trace] add ability to filter by value and occurences -->
* vercel/turborepo#8287 <!-- Donny/강동윤 - feat:
Update `swc_core` to `v0.92.10` -->
* vercel/turborepo#8037 <!-- Alexander Lyon - create
turbo-static for compile time graph analysis -->
* vercel/turborepo#8293 <!-- Will Binns-Smith - Sync
Cargo.lock with Next.js -->
* vercel/turborepo#8239 <!-- Benjamin Woodruff -
Reduce amount of code generated by ValueDebugFormat -->
* vercel/turborepo#8304 <!-- Benjamin Woodruff -
Minor optimizations to the codegen of TaskFnInputFunction -->
* vercel/turborepo#8221 <!-- Donny/강동윤 - perf:
Introduce `RcStr` -->


### What?

I tried using `Arc<String>` in
vercel/turborepo#7772, but a team member suggested
creating a new type so we can replace underlying implementation easily
in the future.

### Why?

To reduce memory usage.

### How?

Closes PACK-2776
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Aug 15, 2024
* vercel/turborepo#8272 <!-- Donny/강동윤 - feat:
Update `swc_core` to `v0.92.8` -->
* vercel/turborepo#8262 <!-- Alexander Lyon - add
crate to calculate prehashes -->
* vercel/turborepo#8174 <!-- Tobias Koppers - use
prehash to avoid rehashing the key in the task cache -->
* vercel/turborepo#7674 <!-- Alexander Lyon - [turbo
trace] add ability to filter by value and occurences -->
* vercel/turborepo#8287 <!-- Donny/강동윤 - feat:
Update `swc_core` to `v0.92.10` -->
* vercel/turborepo#8037 <!-- Alexander Lyon - create
turbo-static for compile time graph analysis -->
* vercel/turborepo#8293 <!-- Will Binns-Smith - Sync
Cargo.lock with Next.js -->
* vercel/turborepo#8239 <!-- Benjamin Woodruff -
Reduce amount of code generated by ValueDebugFormat -->
* vercel/turborepo#8304 <!-- Benjamin Woodruff -
Minor optimizations to the codegen of TaskFnInputFunction -->
* vercel/turborepo#8221 <!-- Donny/강동윤 - perf:
Introduce `RcStr` -->

I tried using `Arc<String>` in
vercel/turborepo#7772, but a team member suggested
creating a new type so we can replace underlying implementation easily
in the future.

To reduce memory usage.

Closes PACK-2776
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Aug 16, 2024
* vercel/turborepo#8272 <!-- Donny/강동윤 - feat:
Update `swc_core` to `v0.92.8` -->
* vercel/turborepo#8262 <!-- Alexander Lyon - add
crate to calculate prehashes -->
* vercel/turborepo#8174 <!-- Tobias Koppers - use
prehash to avoid rehashing the key in the task cache -->
* vercel/turborepo#7674 <!-- Alexander Lyon - [turbo
trace] add ability to filter by value and occurences -->
* vercel/turborepo#8287 <!-- Donny/강동윤 - feat:
Update `swc_core` to `v0.92.10` -->
* vercel/turborepo#8037 <!-- Alexander Lyon - create
turbo-static for compile time graph analysis -->
* vercel/turborepo#8293 <!-- Will Binns-Smith - Sync
Cargo.lock with Next.js -->
* vercel/turborepo#8239 <!-- Benjamin Woodruff -
Reduce amount of code generated by ValueDebugFormat -->
* vercel/turborepo#8304 <!-- Benjamin Woodruff -
Minor optimizations to the codegen of TaskFnInputFunction -->
* vercel/turborepo#8221 <!-- Donny/강동윤 - perf:
Introduce `RcStr` -->

I tried using `Arc<String>` in
vercel/turborepo#7772, but a team member suggested
creating a new type so we can replace underlying implementation easily
in the future.

To reduce memory usage.

Closes PACK-2776
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