Skip to content

how do I decrease stack usage of memchr::memmem::Finder? #164

Answered by BurntSushi
BurntSushi asked this question in Q&A
Discussion options

You must be logged in to vote

so I have an issue that ties into this one, and solving this issue can help solve that. The SearcherKind enum is a bit too fat, especially on an avx2 supported cpu, it has two copies of the sse2 Finder along with an avx2 Finder, making the whole thing 288 bytes on x86_64, and I would benefit from having that go down to reduce memory usage.

It's not really SearcherKind itself. It's the stuff inside of it. SearcherKind is a union, and its biggest member is TwoWayWithPrefilter. And that in turn contains a PrefilterKind, which is another union, very similar to SearcherKind. And its biggest member is memchr::arch::x86_64::avx2::packedpair::Finder, at 160 bytes on my x86-64 machine. And that F…

Replies: 1 comment 7 replies

Comment options

BurntSushi
Oct 8, 2024
Maintainer Author

You must be logged in to vote
7 replies
@BurntSushi
Comment options

BurntSushi Oct 8, 2024
Maintainer Author

@Ambyjkl
Comment options

@BurntSushi
Comment options

BurntSushi Oct 8, 2024
Maintainer Author

@Ambyjkl
Comment options

@BurntSushi
Comment options

Answer selected by BurntSushi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants