Elco Jacobs
Elco Jacobs
I don't think I was using 128 bit. Even multiplying a 32 bit elastic number with a uint16 gives a compile error.
What I want from the type is: - `auto c = a * b` results in c being twice the width of a and b. - `decltype(a) c = a...
Another issue I noticed: Why do the commented lines result in an overflow exception? https://godbolt.org/z/fv5NKk Same program with fsanitize doesn't even work: https://godbolt.org/z/MtmYsW
Thanks for looking into it John. I added the for loop to prevent the compiler from optimizing the calculations away. I absolutely expect the sanitizer to insert some extra code...
I was compiling with -Og. I have even tried compiling with -Os and -O3. I'll try to profile the code with callgrind, see if I can find the performance bottlenecks...
I isolated some tests in a separate build: https://github.com/elcojacobs/brewblox-firmware/tree/feature/cnl-updates/lib/cnltest In the profiler, I saw that almost all execution time was spent in to_chars, which is understandably a heavy function that...
That was not the entire story! `cnl::convert_operator` was not optimizing away and accounted for a huge chunk of the execution time. I could be using the library incorrectly, but perhaps...
Profiling screenshot with template arguments:  It looks like my tests are spending most of the time in this conversion. With native rounding, it shouldn't be more than a binary...
With these changes https://github.com/elcojacobs/brewblox-firmware/commit/065caeced992997cbdad8a19e56ec8689fa991bf , the time spent in PID::update() is reduced to 10%. But it does make the tests fail. The error seems to be here: ``` out_t excess...
Thanks for all the info, here is status update from my side: With these changes: https://github.com/BrewBlox/brewblox-firmware/compare/fcecbd123cd6a74ab9b3d1c64eb0b1d89049e115...elcojacobs:feature/cnl-updates **The total runtime of the tests (without sanitizer) is reduced to 4.7 seconds!** With...