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

Charge for BTreeSet #1381

Merged
merged 1 commit into from
Apr 4, 2024
Merged

Charge for BTreeSet #1381

merged 1 commit into from
Apr 4, 2024

Conversation

jayz22
Copy link
Contributor

@jayz22 jayz22 commented Apr 3, 2024

What

Charge for BTreeSet creation in the ParsedModule/ModueCache

Why

The BTreeSet was the right structure to use, but its cost was not charged for by the budget.
Here we account for the cost of its creation (memory allocation, copy).

Known limitations

Using MeteredMap would be more correct from metering perspective, which accounts for all look-ups and insertions. However, it is too inconvenient to use (every insertion creates a new map), and the extra lookup/insertion costs should be limited to worth the churn.

@graydon graydon enabled auto-merge April 3, 2024 23:39
@graydon graydon added this pull request to the merge queue Apr 3, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to a conflict with the base branch Apr 3, 2024
@graydon graydon added this pull request to the merge queue Apr 4, 2024
Merged via the queue into stellar:main with commit c3a6003 Apr 4, 2024
13 checks passed
@graydon graydon deleted the declared_size branch April 4, 2024 00:40
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.

None yet

2 participants