-
Notifications
You must be signed in to change notification settings - Fork 405
fix: add gas usage for composite literals #4020
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
Conversation
🛠 PR Checks SummaryAll Automated Checks passed. ✅ Manual Checks (for Reviewers):
Read More🤖 This bot helps streamline PR reviews by verifying automated checks and providing guidance for contributors and reviewers. ✅ Automated Checks (for Contributors):No automated checks match this pull request. ☑️ Contributor Actions:
☑️ Reviewer Actions:
📚 Resources:Debug
|
Codecov ReportAll modified and coverable lines are covered by tests ✅ 📢 Thoughts on this report? Let us know! |
OpCPUCompositeLit = 50 | ||
OpCPUArrayLit = 137 | ||
OpCPUSliceLit = 183 | ||
OpCPUSliceLit2 = 467 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The constant list here represents an average value derived from the benchmark. As such, it won’t be precise for a composite literal with a dynamic size. To make it accurate—specifically for a slice literal—we would need to first measure the doOpSliceLit2 shallowly, and then dynamically assess the per-element consumption for the dynamic part. This would complicate the benchmark. This isn’t just about this PR but also relates to #3921.
Closes 3689