Conversation
|
have you critically tested this? first off, I think the "big" encode LUT is a bit of overdoing it, and it is actuially not so clear that it really brings a gain. Unless prooven with hard facts worth it I would not do that. the "small" decode LUT is something I have given a couple of serious attempts, but I never could get it worked out how to do the final byte, i.e., termination of the stream. |
|
Before I spend time on - is it worth measuring how long the current decode takes to see if this is worth trying to improve? For example, if it takes 50 uS and can only happen 19 / sec then probably not worth the efforts. |
|
I think it would be interesting to measure the consumed time alone from a general perspective, to just know that better. The "small" decode LUT is like the part which has the largest impact, since it potentially has to read multiple times in tiny bit junks. So, while I agree that it might not be most important, I personally just have a sort of eagerness ... it naggs me :) One "argument" for getting it fast enough could be, that if it's fast enough we could also enable compression for, e.g., teh 31 Hz mode. 50Hz and higher makes probably no sense, but 31 Hz is just sufficiently enough, so here it could make sense. As regards my concerns, let me give a case which I think which currently fails: |
|
the fix looks AI generated but teh AI not really seeing the issue I guess a working approach could be to do the LUT until the third last byte, and then switch to the bits approach for the rest ... but isn't nice code at all ... I always thought there must be a smarter way. Anyway, the point is, there is some complexity in here. |
|
Had the tool propose a few different decode methods (all over my head). I measured relative performance using TS_START / TS_END and saw:
On 48 MHz CPU - I saw around 1 ms per second spent decoding with the original method and ~775 uS with fused. Others fall in between this. |
|
a quick look didn't allow mne to understand the different techniques, will have to look at it sometimes else just to get the reference right: "original" refers to what we currently use in v1.3.08, i.e., with the bit buffers, or does it refer to what we had all time before? |
Correct |
|
ok, I'm then not surprised that the further efforst don't bring that much. I think I may have mentioned that IMHO the bit buffers should have brought the biggest improvement. It's fantastic though to have some numbers. when you say ~ 1 ms, then this refers to what? |
Use LUT for MAVLinkX Encode/Decode