how do I decrease stack usage of memchr::memmem::Finder
?
#164
-
The Original context for this question comes from #160 (comment) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
It's not really So, using Now, you could instead just use Of course, the easiest way to reduce stack usage is to box it. That's ultimately what I had in mind: for callers that care a lot about stack usage, they can just box the finder. This means using more heap of course, but it might be a beneficial trade-off depending. The reason why Finally, the last resort for folks that need to prioritize stack size above all else is to use I overall think that |
Beta Was this translation helpful? Give feedback.
It's not really
SearcherKind
itself. It's the stuff inside of it.SearcherKind
is a union, and its biggest member isTwoWayWithPrefilter
. And that in turn contains aPrefilterKind
, which is another union, very similar toSearcherKind
. And its biggest member ismemchr::arch::x86_64::avx2::packedpair::Finder
, at 160 bytes on my x86-64 machine. And thatF…