> From: wander.lair...@gmail.com
> Date: Sat, 13 Apr 2013 11:50:08 -0300
> To: pyusb-users@lists.sourceforge.net
> Subject: Re: [pyusb-users] Read speed improvement.
> 
> 2013/4/2 Tomasz Hemperek <thempe...@gmail.com>:
> >
> > Dear All,
> >
> > I am not sure if i should open a ticket so I am writing here.
> > Remark: I am very new to python (1 week).
> >
> > I found that small change improves max read transfer speed.
> > In my case from ~5MB/s to ~15MB/s (~15MB/s is the limit for this device).
> >
> > The problem is in initialization of _interop.as_arrary
> >
> > Example in libusb1.py in __read function the memory is allocated this way:
> >   data = _interop.as_array((0,) * size)
> > this creates a tuple of size and then an array.
> >
> > If you change initialization to
> >    data = _interop.as_array( '\x00' * size )
> > makes it much faster.
> >
> > Example speed test: http://dl.dropbox.com/u/2937630/code/array_init_test.py
> >
> > For write - core.write could recognize if it receives type==array.array ant
> > not to reinitialize memory.
> >
> 
> Sorry for the long delay in answering your question. Would you mind
> opening a ticket in github?
Good!But in "normal" calls I don't get much improve.. Send 5 bytes to a device 
(PIC18F4550) and read 5 takes 0,0019843.. secondsin average.I use "bulk" write 
and read. This time is "normal" or the problem would befirmware of the PIC?
Regards!
Alan
The code:http://sourceforge.net/p/butia/code/ci/master/tree/pybot/
> -- 
> Best Regards,
> Wander Lairson Costa
> 
> ------------------------------------------------------------------------------
> Precog is a next-generation analytics platform capable of advanced
> analytics on semi-structured data. The platform includes APIs for building
> apps and a phenomenal toolset for data science. Developers can use
> our toolset for easy data analysis & visualization. Get a free account!
> http://www2.precog.com/precogplatform/slashdotnewsletter
> _______________________________________________
> pyusb-users mailing list
> pyusb-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/pyusb-users
                                          
------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
pyusb-users mailing list
pyusb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyusb-users

Reply via email to