Closed dcrc2 closed 2 years ago
Can we be confident that this is fine from the point of view of performance? The reason for ks::Tuple
existing at all is that it has better performance than std::tuple
(under certain circumstances). Are there some tests or benchmarks we can put in place to make sure we don't degrade performance when switching to std::tuple
here?
Can we be confident that this is fine from the point of view of performance? The reason for
ks::Tuple
existing at all is that it has better performance thanstd::tuple
(under certain circumstances). Are there some tests or benchmarks we can put in place to make sure we don't degrade performance when switching tostd::tuple
here?
I'm confident that any difference won't be measurable. The main reasons for this:
std::tuple
objects is at worst a constant-time overhead.std::tuple
access will be small compared to this (which is itself still constant-time).Since the goal of this PR is to remove the ks::Tuple
-binding code, I don't think we can maintain a benchmark which compares the performance without defeating the purpose of the PR. I can try running the existing benchmarks before and after but it'll be surprising if there's any observable difference.
Thanks for the explanation. I'm happy for you to proceed as you see fit.
Happy to remove the logging, and happy with PR in general.
This PR changes the entry points to use
std::tuple
, as this is supported directly by pybind11. This would mean that we could remove the specialization forks::Tuple
inknossos-pybind.h
.(Edited: The following comment was resolved by #961.)
One difficulty: we are optionally logging the entry point arguments using
operator<<
, but there is nooperator<<
defined forstd::tuple
. There are various ways we might fix this:operator<<
forstd::tuple
. This invasion ofstd::
is technically illegal, but would probably work as long as no-one tries the same thing somewhere else.print
function to use instead ofoperator<<
.Any thoughts? (@awf?)