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

Optimize codecs context cacheing #1195

Merged
merged 1 commit into from
Feb 13, 2025
Merged

Optimize codecs context cacheing #1195

merged 1 commit into from
Feb 13, 2025

Conversation

1st1
Copy link
Member

@1st1 1st1 commented Feb 13, 2025

We should really copy the cached codex context for cloned Options instances (unless .withCodecs() was called).

We should really copy the cached codex context for cloned
Options instances (unless .withCodecs() was called).
@1st1 1st1 requested review from scotttrinh and jaclarke February 13, 2025 07:22
Copy link
Collaborator

@scotttrinh scotttrinh left a comment

Choose a reason for hiding this comment

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

Nice improvement 👍

@scotttrinh scotttrinh merged commit f42eadf into master Feb 13, 2025
9 checks passed
@scotttrinh scotttrinh deleted the opt branch February 13, 2025 10:42
Comment on lines +285 to +286
clone.cachedCodecContext = this.cachedCodecContext;
clone.cachedCodecContextVer = this.cachedCodecContextVer;
Copy link
Member

Choose a reason for hiding this comment

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

clone.cachedCodecContext = this.makeCodecContext();

If we want maximum caching™ we should make sure the cachedCodecContext is actually initalised before we copy it.

Copy link
Member Author

Choose a reason for hiding this comment

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

There's a check when the cache is used, I think that check is enough.

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