-
Notifications
You must be signed in to change notification settings - Fork 565
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
Iterable ordered map alternative with improved performance #1152
Iterable ordered map alternative with improved performance #1152
Conversation
94567db
to
39084fe
Compare
39084fe
to
2c82b79
Compare
maybe use below interface?
so we can use more efficient way to store map, for example: two slices
|
Looks great.
|
6a00681
to
00729d0
Compare
you can also benchmark reflect map
|
add benchmark reflect map.
|
2d4f09a
to
1b9a601
Compare
@hanjm thanks for your contribution! Before I jump into review, could you elaborate on this implementation please? |
The problem I ran into was that when writing to map columns, a lot of time was wasted in the reflect operation |
@timmy21 I understand the reasoning, but I want to understand what is your proposal to solve this. |
By defining a map interface, this allows user to store map using different data structure, so that avoiding the reflect overhead and improve current OrderedMap interface performance. for example use Pairs:
|
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.
Overall it looks good. Only minor naming convention changes.
Would be great if we provide additional example.
Co-authored-by: Kuba Kaflik <[email protected]>
Co-authored-by: Kuba Kaflik <[email protected]>
02623c4
to
c596f39
Compare
c596f39
to
9a0d0d5
Compare
@jkaflik, Thanks, done. |
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [github.com/ClickHouse/clickhouse-go/v2](https://togithub.com/ClickHouse/clickhouse-go) | `v2.16.0` -> `v2.17.0` | [![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fClickHouse%2fclickhouse-go%2fv2/v2.17.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/go/github.com%2fClickHouse%2fclickhouse-go%2fv2/v2.17.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/go/github.com%2fClickHouse%2fclickhouse-go%2fv2/v2.16.0/v2.17.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fClickHouse%2fclickhouse-go%2fv2/v2.16.0/v2.17.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>ClickHouse/clickhouse-go (github.com/ClickHouse/clickhouse-go/v2)</summary> ### [`v2.17.0`](https://togithub.com/ClickHouse/clickhouse-go/blob/HEAD/CHANGELOG.md#v2170-2023-12-21----Release-notes-generated-using-configuration-in-githubreleaseyml-at-main---) [Compare Source](https://togithub.com/ClickHouse/clickhouse-go/compare/v2.16.0...v2.17.0) #### What's Changed ##### Enhancements 🎉 - Iterable ordered map alternative with improved performance by [@​hanjm](https://togithub.com/hanjm) in [https://github.com/ClickHouse/clickhouse-go/pull/1152](https://togithub.com/ClickHouse/clickhouse-go/pull/1152) - Support bool alias type by [@​yogasw](https://togithub.com/yogasw) in [https://github.com/ClickHouse/clickhouse-go/pull/1156](https://togithub.com/ClickHouse/clickhouse-go/pull/1156) ##### Fixes 🐛 - Update README - mention HTTP protocol usable only with `database/sql` interface by [@​jkaflik](https://togithub.com/jkaflik) in [https://github.com/ClickHouse/clickhouse-go/pull/1160](https://togithub.com/ClickHouse/clickhouse-go/pull/1160) - Fix README example for Debugf by [@​aramperes](https://togithub.com/aramperes) in [https://github.com/ClickHouse/clickhouse-go/pull/1153](https://togithub.com/ClickHouse/clickhouse-go/pull/1153) #### New Contributors - [@​yogasw](https://togithub.com/yogasw) made their first contribution in [https://github.com/ClickHouse/clickhouse-go/pull/1156](https://togithub.com/ClickHouse/clickhouse-go/pull/1156) - [@​aramperes](https://togithub.com/aramperes) made their first contribution in [https://github.com/ClickHouse/clickhouse-go/pull/1153](https://togithub.com/ClickHouse/clickhouse-go/pull/1153) **Full Changelog**: ClickHouse/clickhouse-go@v2.16.0...v2.17.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - "on tuesday" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/open-telemetry/opentelemetry-collector-contrib). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4xMDMuMSIsInVwZGF0ZWRJblZlciI6IjM3LjEwMy4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9--> --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: opentelemetrybot <[email protected]> Co-authored-by: Bogdan Drutu <[email protected]>
…-telemetry#30217) [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [github.com/ClickHouse/clickhouse-go/v2](https://togithub.com/ClickHouse/clickhouse-go) | `v2.16.0` -> `v2.17.0` | [![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fClickHouse%2fclickhouse-go%2fv2/v2.17.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/go/github.com%2fClickHouse%2fclickhouse-go%2fv2/v2.17.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/go/github.com%2fClickHouse%2fclickhouse-go%2fv2/v2.16.0/v2.17.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fClickHouse%2fclickhouse-go%2fv2/v2.16.0/v2.17.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>ClickHouse/clickhouse-go (github.com/ClickHouse/clickhouse-go/v2)</summary> ### [`v2.17.0`](https://togithub.com/ClickHouse/clickhouse-go/blob/HEAD/CHANGELOG.md#v2170-2023-12-21----Release-notes-generated-using-configuration-in-githubreleaseyml-at-main---) [Compare Source](https://togithub.com/ClickHouse/clickhouse-go/compare/v2.16.0...v2.17.0) #### What's Changed ##### Enhancements 🎉 - Iterable ordered map alternative with improved performance by [@&open-telemetry#8203;hanjm](https://togithub.com/hanjm) in [https://github.com/ClickHouse/clickhouse-go/pull/1152](https://togithub.com/ClickHouse/clickhouse-go/pull/1152) - Support bool alias type by [@&open-telemetry#8203;yogasw](https://togithub.com/yogasw) in [https://github.com/ClickHouse/clickhouse-go/pull/1156](https://togithub.com/ClickHouse/clickhouse-go/pull/1156) ##### Fixes 🐛 - Update README - mention HTTP protocol usable only with `database/sql` interface by [@&open-telemetry#8203;jkaflik](https://togithub.com/jkaflik) in [https://github.com/ClickHouse/clickhouse-go/pull/1160](https://togithub.com/ClickHouse/clickhouse-go/pull/1160) - Fix README example for Debugf by [@&open-telemetry#8203;aramperes](https://togithub.com/aramperes) in [https://github.com/ClickHouse/clickhouse-go/pull/1153](https://togithub.com/ClickHouse/clickhouse-go/pull/1153) #### New Contributors - [@&open-telemetry#8203;yogasw](https://togithub.com/yogasw) made their first contribution in [https://github.com/ClickHouse/clickhouse-go/pull/1156](https://togithub.com/ClickHouse/clickhouse-go/pull/1156) - [@&open-telemetry#8203;aramperes](https://togithub.com/aramperes) made their first contribution in [https://github.com/ClickHouse/clickhouse-go/pull/1153](https://togithub.com/ClickHouse/clickhouse-go/pull/1153) **Full Changelog**: ClickHouse/clickhouse-go@v2.16.0...v2.17.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - "on tuesday" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/open-telemetry/opentelemetry-collector-contrib). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4xMDMuMSIsInVwZGF0ZWRJblZlciI6IjM3LjEwMy4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9--> --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: opentelemetrybot <[email protected]> Co-authored-by: Bogdan Drutu <[email protected]>
Summary
fix #1151, introduce a v2 interface for type assert.
Checklist
Delete items not relevant to your PR: