Page 1 of 1

Sample based decoding is slow - why not transition based?

PostPosted: Fri Feb 26, 2016 2:02 am
by 0xdeadbeef
I guess this is inherited from Sigrok, but protocol decoding is extremely slow (I tried UART). Don't know if it's the decoder script implementation, the API or the application, but it looks like every sample is checked in a loop instead of jumping from transition to transition. So a few UART bytes in one second take minutes to decode with 128M samples.
IMHO a transition based decoding approach could increase the speed massively. E.g. Ikalogic ScanaStudio (Scanaplus) decodes the very same signal with 100MHz resolution immediately (and the decoder script are JavaScript, so it's probably not a very efficient implementation but just a better approach).
And for the meantime: why not at least display what has already been decoded during decoding?

Re: Sample based decoding is slow - why not transition based

PostPosted: Thu Mar 24, 2016 10:51 pm
by Andy
The protocol decoding is implemented by python script.
You are right, under current implementation, every sample will be checked.
In most of case, this will not be the problem. you just need to setting a reasonable sample rate.
For UART signal, a 1MHz sample rate is enough.
Under the same sample time, 1M depth@1MHz is almost equal to 128M depth@100MHz
But the decoder will have 100x speedup.

We know this is not the best way. But most of the case, you can avoid the problem.
And we will also take time to improve this.