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

Cache the value of internaltext in a unit buffer when it is not altered. #378

Merged
merged 1 commit into from
Nov 18, 2024

Conversation

johanvos
Copy link
Contributor

Mark a buffer dirty on any operation.
Fix #377

@johanvos johanvos requested a review from jperedadnr November 17, 2024 11:55
Copy link
Collaborator

@jperedadnr jperedadnr left a comment

Choose a reason for hiding this comment

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

Looks good. There are a couple of other places (getText() and getLength()) that could use a cache too, with the same dirty flag?

@johanvos
Copy link
Contributor Author

Looks good. There are a couple of other places (getText() and getLength()) that could use a cache too, with the same dirty flag?

True. I thought about doing those as well, but I didn't do that yet for the following reason: I have no 100% guarantees that the structure is not dirty unless we set it to dirty (there are possible paths outside the methods that now set dirty to true). In that case, there will be a mismatch between the text/length and internaltext that will lead to IndexOutOfBoundExceptions, which are a marker for wrong cache invalidations.

@johanvos johanvos merged commit 501ff69 into gluonhq:main Nov 18, 2024
3 checks passed
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.

performance: cache internaltext of unitbuffer
2 participants