Skip to content

Consistently use pointer receiver for ByteArray #9120

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nicktobey
Copy link
Contributor

Similar to #9100

For structs that are exclusively used in interfaces, there's no reason to not use pointer receivers instead of value receivers. Using value receivers can cause the struct to be copied every time the method is invoked.

Pointer receivers are also more correct here: copying the struct means that changes to the ImmutableValue field (such as setting its Buf field in ImmutableValue.GetBytes) won't be saved when the method exits, defeating the caching of values loaded from storage.

@coffeegoddd
Copy link
Contributor

@nicktobey DOLT

comparing_percentages
100.000000 to 100.000000
version result total
41b7080 ok 5937457
version total_tests
41b7080 5937457
correctness_percentage
100.0

@nicktobey
Copy link
Contributor Author

#benchmark

Copy link

@coffeegoddd
Copy link
Contributor

@nicktobey DOLT

test_name from_latency_p95 to_latency_p95 percent_change
tpcc-scale-factor-1 64.47 61.08 -5.26
test_name from_server_name from_server_version from_tps to_server_name to_server_version to_tps percent_change
tpcc-scale-factor-1 dolt b5883dc 39.34 dolt 41b7080 39.34 0.0

@coffeegoddd
Copy link
Contributor

@nicktobey DOLT

read_tests from_latency to_latency percent_change
covering_index_scan 0.65 0.67 3.08
groupby_scan 17.63 17.63 0.0
index_join 2.39 2.39 0.0
index_join_scan 1.44 1.44 0.0
index_scan 30.26 30.26 0.0
oltp_point_select 0.26 0.27 3.85
oltp_read_only 5.18 5.18 0.0
select_random_points 0.59 0.6 1.69
select_random_ranges 0.62 0.62 0.0
table_scan 32.53 32.53 0.0
types_table_scan 125.52 123.28 -1.78
write_tests from_latency to_latency percent_change
oltp_delete_insert 6.32 6.32 0.0
oltp_insert 3.07 3.13 1.95
oltp_read_write 11.45 11.45 0.0
oltp_update_index 3.19 3.19 0.0
oltp_update_non_index 3.07 3.07 0.0
oltp_write_only 6.32 6.32 0.0
types_delete_insert 6.67 6.67 0.0

@nicktobey
Copy link
Contributor Author

#benchmark

Copy link

@coffeegoddd
Copy link
Contributor

@nicktobey DOLT

test_name from_latency_p95 to_latency_p95 percent_change
tpcc-scale-factor-1 62.19 64.47 3.67
test_name from_server_name from_server_version from_tps to_server_name to_server_version to_tps percent_change
tpcc-scale-factor-1 dolt c3b3b7e 39.5 dolt 41b7080 38.94 -1.42

@coffeegoddd
Copy link
Contributor

@nicktobey DOLT

read_tests from_latency to_latency percent_change
covering_index_scan 0.67 0.67 0.0
groupby_scan 17.63 17.63 0.0
index_join 2.39 2.39 0.0
index_join_scan 1.44 1.44 0.0
index_scan 30.81 30.26 -1.79
oltp_point_select 0.26 0.26 0.0
oltp_read_only 5.18 5.18 0.0
select_random_points 0.6 0.6 0.0
select_random_ranges 0.62 0.62 0.0
table_scan 31.94 33.12 3.69
types_table_scan 130.13 123.28 -5.26
write_tests from_latency to_latency percent_change
oltp_delete_insert 6.21 6.32 1.77
oltp_insert 3.07 3.13 1.95
oltp_read_write 11.45 11.45 0.0
oltp_update_index 3.13 3.19 1.92
oltp_update_non_index 3.07 3.07 0.0
oltp_write_only 6.32 6.32 0.0
types_delete_insert 6.67 6.67 0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants