2011/5/11 Emmanuel BOUAZIZ <eboua...@neotion.com>: > Hi Wander, > > thank you for your answer. > > I tried your patch and got no improvement. > > get_endpoint_type() on line 603 is now called with an interface number > instead of an Interface object and passes that > parameter to get_interface(), so the slow get_interface() call is made on > line 183 instead of line 602. > > (get_interface() gets slow when it calls find_descriptor() which calls > desc_iter()) > > I don't see how to suppress the call to get_interface() in > get_endpoint_type() as you need the bAlternateSetting attribute. > > Note that the solution of calling read() and write() with the Interface > (which is easy to retrieve once for all) object > instead of the interface number works fine so it's not a major issue. > > Also, when you reach line 609, you need to call fn() with intf instead of > intf.bInterfaceNumber now. > Yes, you are right, I haven't realized that. It seems that to keep things easy we can't run away of this kind of trade off..
Wander ------------------------------------------------------------------------------ Achieve unprecedented app performance and reliability What every C/C++ and Fortran developer should know. Learn how Intel has extended the reach of its next-generation tools to help boost performance applications - inlcuding clusters. http://p.sf.net/sfu/intel-dev2devmay _______________________________________________ pyusb-users mailing list pyusb-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pyusb-users