Skip to content

[Merged by Bors] - fix(Cache): do not read lake-manifest.json at import-time - #11492

Closed
eric-wieser wants to merge 2 commits into
masterfrom
eric-wieser/cache-no-reread
Closed

eric-wieser wants to merge 2 commits into
masterfrom
eric-wieser/cache-no-reread

Conversation

@eric-wieser

@eric-wieser eric-wieser commented Mar 18, 2024 •

Copy link
Copy Markdown
Member

Previously this file was read four times at runtime, and once for each file at compile time. Now it is read only once, when lake exe cache is run.

initialize is not a substitute for correctly passing global state through a program; my impression is that it is intended for language- rather than program-level initialization.

The performance impact is negligible, but the new code is more predictable.

Tested on mathlib, and on a package created using lake new foo math, pointed at this mathlib branch. lake exe cache get works correctly (leaves lake build with nothing to do) in both cases.


Open in Gitpod

Previously this file was read four times at runtime, and once for each file at compiletime.
Now it is read only at startup.
@eric-wieser
eric-wieser requested a review from kim-em March 18, 2024 23:30
@eric-wieser eric-wieser added awaiting-review t-meta Tactics, attributes or user commands labels Mar 18, 2024
@eric-wieser
eric-wieser requested a review from digama0 March 18, 2024 23:36
@kim-em

kim-em commented Mar 19, 2024

Copy link
Copy Markdown
Contributor

bors merge

@github-actions github-actions Bot added ready-to-merge This PR has been sent to bors. and removed awaiting-review labels Mar 19, 2024
mathlib-bors Bot pushed a commit that referenced this pull request Mar 19, 2024
Previously this file was read four times at runtime, and once for each file at compile time. Now it is read only once, when `lake exe cache` is run.

`initialize` is not a substitute for correctly passing global state through a program; my impression is that it is intended for *language-* rather than program-level initialization.

The performance impact is negligible, but the new code is more predictable.

Tested on mathlib, and on a package created using `lake new foo math`, pointed at this mathlib branch. `lake exe cache get` works correctly (leaves `lake build` with nothing to do) in both cases.
@mathlib-bors

mathlib-bors Bot commented Mar 19, 2024

Copy link
Copy Markdown
Contributor

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors Bot changed the title fix(Cache): do not read lake-manifest.json at import-time [Merged by Bors] - fix(Cache): do not read lake-manifest.json at import-time Mar 19, 2024
@mathlib-bors mathlib-bors Bot closed this Mar 19, 2024
@mathlib-bors
mathlib-bors Bot deleted the eric-wieser/cache-no-reread branch March 19, 2024 03:58
dagurtomas pushed a commit that referenced this pull request Mar 22, 2024
Previously this file was read four times at runtime, and once for each file at compile time. Now it is read only once, when `lake exe cache` is run.

`initialize` is not a substitute for correctly passing global state through a program; my impression is that it is intended for *language-* rather than program-level initialization.

The performance impact is negligible, but the new code is more predictable.

Tested on mathlib, and on a package created using `lake new foo math`, pointed at this mathlib branch. `lake exe cache get` works correctly (leaves `lake build` with nothing to do) in both cases.
utensil pushed a commit that referenced this pull request Mar 26, 2024
Previously this file was read four times at runtime, and once for each file at compile time. Now it is read only once, when `lake exe cache` is run.

`initialize` is not a substitute for correctly passing global state through a program; my impression is that it is intended for *language-* rather than program-level initialization.

The performance impact is negligible, but the new code is more predictable.

Tested on mathlib, and on a package created using `lake new foo math`, pointed at this mathlib branch. `lake exe cache get` works correctly (leaves `lake build` with nothing to do) in both cases.
xgenereux pushed a commit that referenced this pull request Apr 15, 2024
Previously this file was read four times at runtime, and once for each file at compile time. Now it is read only once, when `lake exe cache` is run.

`initialize` is not a substitute for correctly passing global state through a program; my impression is that it is intended for *language-* rather than program-level initialization.

The performance impact is negligible, but the new code is more predictable.

Tested on mathlib, and on a package created using `lake new foo math`, pointed at this mathlib branch. `lake exe cache get` works correctly (leaves `lake build` with nothing to do) in both cases.
atarnoam pushed a commit that referenced this pull request Apr 16, 2024
Previously this file was read four times at runtime, and once for each file at compile time. Now it is read only once, when `lake exe cache` is run.

`initialize` is not a substitute for correctly passing global state through a program; my impression is that it is intended for *language-* rather than program-level initialization.

The performance impact is negligible, but the new code is more predictable.

Tested on mathlib, and on a package created using `lake new foo math`, pointed at this mathlib branch. `lake exe cache get` works correctly (leaves `lake build` with nothing to do) in both cases.
uniwuni pushed a commit that referenced this pull request Apr 19, 2024
Previously this file was read four times at runtime, and once for each file at compile time. Now it is read only once, when `lake exe cache` is run.

`initialize` is not a substitute for correctly passing global state through a program; my impression is that it is intended for *language-* rather than program-level initialization.

The performance impact is negligible, but the new code is more predictable.

Tested on mathlib, and on a package created using `lake new foo math`, pointed at this mathlib branch. `lake exe cache get` works correctly (leaves `lake build` with nothing to do) in both cases.
callesonne pushed a commit that referenced this pull request Apr 22, 2024
Previously this file was read four times at runtime, and once for each file at compile time. Now it is read only once, when `lake exe cache` is run.

`initialize` is not a substitute for correctly passing global state through a program; my impression is that it is intended for *language-* rather than program-level initialization.

The performance impact is negligible, but the new code is more predictable.

Tested on mathlib, and on a package created using `lake new foo math`, pointed at this mathlib branch. `lake exe cache get` works correctly (leaves `lake build` with nothing to do) in both cases.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge This PR has been sent to bors. t-meta Tactics, attributes or user commands

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants