Return geometry by value (alternative 3)
In this PR, the idea is that the geometry holds all the corners of the cell. This because in most of the cases, the geometry is constructed in place and the compiler theoretically could see through the things that are actually needed and only generate code for that. In other words, it would avoid making the copy if those values are not used.
Here is a benchmark for that hypothesis: https://quick-bench.com/q/IPXA-MuhVrdQ_9DSbgbcAyRW9ek
- Indeed, this seems to be the case in GCC and there is no difference between storing the values or the pointers to the values.
- Sadly, the picture changes for Clang and storing the values is 5 times more expensive even if only the center of the geometry is being used.
Note that this PR is based on #885 which fixes all the lifetime issues of the geometry objects.
jenkjns build this please
jenkins build this please
jenkins build this serial please
jenkins build this serial please