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

qvalue: pass by value #813

Merged
merged 2 commits into from
Dec 13, 2023
Merged

qvalue: pass by value #813

merged 2 commits into from
Dec 13, 2023

Conversation

serprex
Copy link
Contributor

@serprex serprex commented Dec 13, 2023

QValue is a string/interface{} pair
string is a pointer/int pair
interface{} is a pointer/pointer pair

Copying four words is cheap, especially when for the most part qvalues are stored in a QRecord which will itself be passed around by pointer

Include a QValueKindEmpty which is used in places where previously pointer would be nil

@serprex
Copy link
Contributor Author

serprex commented Dec 13, 2023

No benchmarks, but...

Copy link
Contributor

@iskakaushik iskakaushik left a comment

Choose a reason for hiding this comment

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

approved modulo the pre-allocation change we discussed!

QValue is a string/interface{} pair
string is a pointer/int pair
interface{} is a pointer/pointer pair

Copying four words is cheap, especially when for the most part qvalues are stored in a QRecord which will itself be passed around by pointer
@serprex serprex merged commit 9cb34e5 into main Dec 13, 2023
@serprex serprex deleted the qvalue-by-value branch December 19, 2023 16:36
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.

2 participants