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

Move Python snapshot logic to its own file #1879

Merged
merged 1 commit into from
Apr 3, 2024

Conversation

hoodmane
Copy link
Contributor

@hoodmane hoodmane commented Mar 22, 2024

Nonfunctional change. This splits python.js (~600 lines) into two files, with ~360 lines moved into snapshot.js. I think it's easier to understand this way.

@hoodmane hoodmane requested review from a team as code owners March 22, 2024 18:30
@hoodmane hoodmane requested review from mikea, jp4a50 and dom96 and removed request for a team March 22, 2024 18:30
@hoodmane hoodmane force-pushed the hoodmane/reduce-snapshot-memory-usage branch from 84687f2 to 34da5ba Compare March 26, 2024 14:24
Base automatically changed from hoodmane/reduce-snapshot-memory-usage to main March 27, 2024 11:16
@hoodmane hoodmane force-pushed the hoodmane/snapshot-own-file branch 2 times, most recently from 742fa66 to fd6c6eb Compare April 3, 2024 10:40
@hoodmane hoodmane changed the title Python snapshot refactor Move Python snapshot logic to its own file Apr 3, 2024
*/
let READ_MEMORY = undefined;
let SNAPSHOT_SIZE = undefined;
export let SHOULD_RESTORE_SNAPSHOT = false;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Instead of exporting a global var, we should be returning this value from the appropriate methods.

In general we should work to get rid of global state as much as we can.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed, but I think fixing this would best be left to a followup; I'm trying to avoid changes if at all possible here b/c moving all the code makes the diff hard to read.

@hoodmane hoodmane merged commit 2ccf659 into main Apr 3, 2024
10 checks passed
@hoodmane hoodmane deleted the hoodmane/snapshot-own-file branch April 3, 2024 13:43
garrettgu10 pushed a commit that referenced this pull request May 13, 2024
Nonfunctional change. This splits python.js (~600 lines) into two files, with ~360 lines moved
into snapshot.js. I think it's easier to understand this way.
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.

2 participants