Skip to content

hash, use single linked list for entries#16351

Closed
icing wants to merge 2 commits intocurl:masterfrom
icing:hash-footprint
Closed

hash, use single linked list for entries#16351
icing wants to merge 2 commits intocurl:masterfrom
icing:hash-footprint

Conversation

@icing
Copy link
Copy Markdown
Contributor

@icing icing commented Feb 16, 2025

Curl's double linked list is proven code, but it comes with some additional memory overhead. Since hash's internal list of elements needs only forward traversals, it seems worthwhile to use a single linked list internally.

This saves 3 pointers per entry plus 3 pointers per slot.

Curl's double linked list is proven code, but it comes with
some additional memory overhead. Since hash's internal list
of elements needs only forward traversals, it seems worthwhile
to use a single linked list internally.

This saves 3 pointers per entry plus 3 pointers per slot.
…s implementation did.

This seems to happen in the multi event handling and maybe worth revisiting
once that refactor has been merged. It seems wrong to destroy a hash twice.
@bagder bagder closed this in 069f9d0 Feb 17, 2025
pps83 pushed a commit to pps83/curl that referenced this pull request Apr 26, 2025
Curl's double linked list is proven code, but it comes with some
additional memory overhead. Since hash's internal list of elements needs
only forward traversals, it seems worthwhile to use a single linked list
internally.

This saves 3 pointers per entry plus 3 pointers per slot.

Closes curl#16351
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants