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

Map iterator #69

Merged
merged 9 commits into from
Dec 19, 2024
Merged

Map iterator #69

merged 9 commits into from
Dec 19, 2024

Conversation

HaoboGu
Copy link
Contributor

@HaoboGu HaoboGu commented Dec 6, 2024

This PR aims to provide an iterator on map values, related to #65 and #65 (comment)

Signed-off-by: Haobo Gu <[email protected]>
@HaoboGu
Copy link
Contributor Author

HaoboGu commented Dec 6, 2024

Current implementation is a very initial implementation. It requires a data buffer for creating MapItemIter and ANOTHER data buffer when getting the next item. I cannot re-use the data buffer since if current page iter ends, I have to loop over again to find the next page iter. I think there should be better solution to eliminate the extra data buffer needed, but I don't know how

@HaoboGu
Copy link
Contributor Author

HaoboGu commented Dec 11, 2024

@diondokter Hi! I think I've finished it. According my tests, compared with just loading all items, the iterator can get 300x speedup(6482ms -> 22ms). Do you have any comments on this PR?

@HaoboGu HaoboGu force-pushed the feat/map_iterator branch 2 times, most recently from e759543 to c297631 Compare December 11, 2024 08:29
Copy link
Collaborator

@diondokter diondokter left a comment

Choose a reason for hiding this comment

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

Thanks!
Good start, but some more work is needed

src/map.rs Show resolved Hide resolved
src/map.rs Outdated Show resolved Hide resolved
src/map.rs Outdated Show resolved Hide resolved
src/map.rs Outdated Show resolved Hide resolved
src/map.rs Outdated Show resolved Hide resolved
src/map.rs Show resolved Hide resolved
@diondokter
Copy link
Collaborator

300x speedup is pretty dope :D

@HaoboGu HaoboGu requested a review from diondokter December 12, 2024 06:41
src/map.rs Outdated Show resolved Hide resolved
src/map.rs Show resolved Hide resolved
src/map.rs Show resolved Hide resolved
@HaoboGu HaoboGu requested a review from diondokter December 19, 2024 06:29
Copy link
Collaborator

@diondokter diondokter left a comment

Choose a reason for hiding this comment

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

Great, thanks for the work!

@diondokter
Copy link
Collaborator

Ah there's some updating I need to do which is why the CI fails. I'll merge regardless

@diondokter diondokter merged commit fac5dfa into tweedegolf:master Dec 19, 2024
3 of 5 checks passed
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