Conversation
8cb6059 to
133f7a7
Compare
|
This is not yet ready for a proper review, but before extending the interface to more heavy types I wanted to check if this was the right way to go about implementing this interface or if this approach misses some important capabilities we would like to see. In particular the python side is still very rough, and something along the lines of https://github.com/timlnx/bitmath/, would be very desirable. |
|
Looks like more-or-less the right direction to me. We should consider how pedantic we want to be, e.g. for a large mesh the memory used by the Basix element will be trivial and do we really care about this. Do we want the truest possible measure of the memory used by an object, or just the storage memory used for parts that depend on problem size? |
|
My understanding is that C++26 reflections could remove a lot of tedious boiler plate required to implement something like this. |
Introduces free function
common::memory. Which provides a unit based access (inB,KB,MB, ...) to the implementation detailcommon::impl::memory, which computes for given types the used memory in bytes. This needs to be implemented for every type of which one wants to have access to a memory consumption (and its member types!).This provides a user controllable memory profiling capability, up to a desired/required precision.
First step towards #1741.
TODO:
__sizeof__/sys.getsizeof