Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

DO NOT MERGE: On disk cache#4963

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
gzm0 wants to merge4 commits intoscala-js:main
base:main
Choose a base branch
Loading
fromgzm0:on-disk-cache
Draft

Conversation

gzm0
Copy link
Contributor

No description provided.

@gzm0
Copy link
ContributorAuthor

Sharing a negative result: This PR attempts to cache printed trees on disk rather than in memory.

However, on the test suite, we save less than 30MB of residual memory onPrintedTree instances.

Baseline: 111MB
This PR: 85MB

Seems like most of the memory usage goes intoSourceMapFragment. I guess the learning is to attempt and optimize that.

/cc@sjrd

@sjrd
Copy link
Member

Huh, that's bold. :P

I'm not really surprised thatSourceMapFragments are the biggest culprit. For every few bytes worth of characters inPrintedTree buffers, there an entireinstance ofFragmentElement.Segment:

privatesealedabstractclassFragmentElement
privateobjectFragmentElement {
caseobjectNewLineextendsFragmentElement
// name is nullable
finalcaseclassSegment(columnInGenerated:Int,pos:Position,name:String)
extendsFragmentElement
}

It might be worth investigating a serialized form ofFragments, which would encode these instances as byte sequences inside a unique buffer perFragment.

@gzm0
Copy link
ContributorAuthor

It might be worth investigating a serialized form of Fragments, which would encode these instances as byte sequences inside a unique buffer per Fragment.

Yeah, I'll take a stab at this.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@gzm0@sjrd

[8]ページ先頭

©2009-2025 Movatter.jp