[IPython-dev] [matplotlib-devel] [Enthought-Dev] Ctypes based prototype of PyOS_InputHook for wx 2.8 and 2.9

Brian Granger ellisonbg.net@gmail....
Fri Jul 17 15:49:35 CDT 2009


Ondrej and Robert,

Thanks for testing this.  Some comments:

2) We can speed up pasting and general keyboard response by changing the
polling time.  Pasting is slow very slow at the original setting of 50.  But
if you make it smaller pasting becomes faster (although still not instant).


3) We can speed up the GUI response by decreasing the time.sleep interval.
The setting of 0.01 works pretty well.

Why not decrease the polling or sleep times even further?  As you descrease
either of these times, the idle CPU load starts to go up.  Here is what I
observe on my MacBook pro (both 2 and 3 show the same result):

polling/sleep time of 1 (ms) gives about 13% CPU load
polling/sleep time of 5 (ms) gives about 3% CPU load
polling/sleep time of 10 (ms) gives about 1.5% CPU load

In summary, method 3 with a time of 10 ms seems like the best overall
approach.  However, I am going to leave in the other methods and make it
easy to set the time intervals.  That way, if people want to optimize their
performance for particular usage cases they can.

Now, onto testing for Windows.  Can anyone help with that?

Thanks,

Brian

On Fri, Jul 17, 2009 at 1:13 PM, Ondrej Certik <ondrej@certik.cz> wrote:

> On Fri, Jul 17, 2009 at 2:07 PM, Ondrej Certik<ondrej@certik.cz> wrote:
> > On Fri, Jul 17, 2009 at 1:57 PM, Robert Kern<rkern@enthought.com> wrote:
> >> On Fri, Jul 17, 2009 at 14:48, Brian Granger<ellisonbg.net@gmail.com>
> wrote:
> >>> Michiel,
> >>>
> >>> Thanks for the ideas.  I have implemented both of the approaches you
> >>> describe and I am attaching a file that has all 3 approaches.  At this
> >>> point, all 3 approaches work on OS X, Python 2.5 with wx 2.8/2.9.  What
> I
> >>> most need to to find strenuous test cases that can probe which of these
> has
> >>> the best performance?  Robert, could you run the Chaco test again with
> >>> approaches 2 and 3 and try tuning the parameters (see the docstrings)?
> >>
> >> #2 was pretty good out-of-box. #3 was slightly better than #1 but
> >> still noticeably chunky. Reducing the sleep down to 0.01 instead of
> >> 0.05 made things appreciably smooth. I thought I noticed a tiny bit of
> >> chunkiness, but I certainly didn't do a double-blind trial.
> >
> > Exactly the same observation on Linux. E.g. #1 the slowest, #3 quite
> > good, #2 perfect. However:
> >
> > with #2, if I did copy and paste of some command into the python
> > terminal, I could see how ipython was putting the command letter by
> > letter on the prompt, e.g. by pasting "inputhook.remove_inputhook()" I
> > could literally see:
> >
> > i
> > in
> > inp
> > inpu
> > ...
> >
> > (everything on one line, e.g. like if there was sleep(0.05) between each
> letter)
> >
> > with #1 and #3, pasting was immediate.
>
> so I also reduced the sleep in #3 from 0.05 to 0.01 and then #3 is
> absolutely smooth for me and also pasting to ipython is immediate e.g.
> this looks like a perfect solution to me.
>
> Ondrej
> _______________________________________________
> IPython-dev mailing list
> IPython-dev@scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-dev/attachments/20090717/b3c43d56/attachment.html 


More information about the IPython-dev mailing list