jdenoy / libmpsse

Automatically exported from code.google.com/p/libmpsse
0 stars 0 forks source link

SPI mode speedup by removing many memcopy #26

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

I see in your code a lot of malloc/memcopy/free calls. All this stuff heavily 
impact the performances (latency) of the code (which are very important on my 
use case) so I wrote a couple of additional files (fast_spi_mpsse.h/c) in order 
to speed-up the SPI (and only SPI) transfer by removing all but one mandatory 
memcopy.
The new functions are basically the same as the ones found in your code except 
that the rx and tx buffer (and their size) need to be provided by the user.

I also did a really minor change on the MPSSE function (interface is now a 
parameter).

I attach the patch file including all the above changes, feel free to to use 
that code by your convenience.

Cheers,
Paolo.

Original issue reported on code.google.com by paolo.za...@tiscali.it on 20 Mar 2013 at 4:55

Attachments:

GoogleCodeExporter commented 9 years ago
Just fixed a couple of warnings and integrated the two new files into make 
file...

Original comment by paolo.za...@tiscali.it on 21 Mar 2013 at 10:09

Attachments:

GoogleCodeExporter commented 9 years ago
here an improved makefile and a full integration with examples code too.

Original comment by paolo.za...@tiscali.it on 21 Mar 2013 at 3:16

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks, in the process of working these patches into the trunk now.

Original comment by heffne...@gmail.com on 22 Mar 2013 at 3:38

GoogleCodeExporter commented 9 years ago
Added the new functions in the latest trunk, thanks!

Original comment by heffne...@gmail.com on 22 Mar 2013 at 7:08