https://github.com/ldionne commented:

I think the most effective way of settling on the bit-stealing issue would be 
to benchmark something like this:

1. Set up ~100 functions that do random stuff (e.g. they all return numbers 
from 1 to 100)
2. Set up a `std::vector<std::move_only_function<int()>>` with some large 
number of functions in it.
3. Assign from the 100 functions randomly into the vector, so that the vector 
contains roughly uniformly distributed function pointers.
4. Measure how long it takes to call all the functions in the vector using this 
bit-stealing implementation, and an implementation where we store a null entry 
in the destructor instead.

Similarly, for this benchmark we could measure the time it takes for destroying 
the vector.

https://github.com/llvm/llvm-project/pull/94670
_______________________________________________
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to