I sent this patch in last July, but got no response yet. So let me try
it again. The below description the patch are same as my last July post.
Recently, I'm performance tuning our gdbproxy, which is based on UrJTAG.
I find that the length of the buffer which usbconn_ftdi_flush passes to
ftdi_write_data is often 4097 or 4098 or a little more. But the
writebuffer_chunksize in libftdi is 4096 by default. For such buffer,
ftdi_write_data calls usb_bulk_write twice, one for write_size = 4096,
the other for write_size = 1 or 2 or another small number. So I proposed
the attached patch, which will avoid those small write_size
usb_bulk_write calls. Testing gdbproxy with our gnICE cable, this patch
gives us more than 15% performance improvement for loading file into memory.
Is it OK?
Jie
* src/tap/usbconn/libftdi.c (usbconn_ftdi_write): Make sure
scheduled send bytes be less than URJ_USBCONN_FTDX_MAXSEND.
Index: src/tap/usbconn/libftdi.c
===================================================================
--- src/tap/usbconn/libftdi.c (revision 1653)
+++ src/tap/usbconn/libftdi.c (working copy)
@@ -201,7 +201,7 @@ usbconn_ftdi_write (urj_usbconn_t *conn,
with this write
Case B: max number of scheduled send bytes has been reached */
if ((p->to_recv + recv > URJ_USBCONN_FTDI_MAXRECV)
- || ((p->send_buffered > URJ_USBCONN_FTDX_MAXSEND)
+ || ((p->send_buffered + len > URJ_USBCONN_FTDX_MAXSEND)
&& (p->to_recv == 0)))
xferred = usbconn_ftdi_flush (p);
------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
UrJTAG-development mailing list
UrJTAG-development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/urjtag-development