Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perfomance problems in python-for-android since 1.12.5 #378

Closed
bobatsar opened this issue Apr 12, 2017 · 2 comments
Closed

perfomance problems in python-for-android since 1.12.5 #378

bobatsar opened this issue Apr 12, 2017 · 2 comments
Labels

Comments

@bobatsar
Copy link

I am using python-for-android and since sh 1.12.5 I see a delay of 1 second to every call of sh.

The usage of sh can be seen in https://github.com/kivy/python-for-android/blob/master/pythonforandroid/logger.py#L141

typical usages are sh.cp or sh.rm

With a git bisect I figured out that the following commit introduced the performance problems.

commit a500762
Author: Andrew Moffat [email protected]
Date: Thu Dec 1 02:27:00 2016 -0600

use a quit event to reduce sleeping/spinning in threads
@amoffat amoffat added the bug label Apr 12, 2017
@amoffat
Copy link
Owner

amoffat commented Apr 12, 2017

Thanks for reporting and finding the regression. I'm able to reproduce the issue on linux when using _iter, which is how shprint is working. I'll try to dig into it soon

# takes 1 second
for line in sh.ls(_iter=True): pass

@amoffat
Copy link
Owner

amoffat commented Jun 7, 2017

Fixed on master, version 1.12.14

@amoffat amoffat closed this as completed Jun 7, 2017
0-wiz-0 added a commit to NetBSD/pkgsrc-wip that referenced this issue Jun 19, 2017
*   bugfix for poor sleep performance [#378](amoffat/sh#378)
*   allow passing raw integer file descriptors for `_out` and `_err` handlers
*   bugfix for when `_tee` and `_out` are used, and the `_out` is a tty or pipe [#384](amoffat/sh#384)
*   bugfix where python 3.3+ detected different arg counts for bound method output callbacks [#380](amoffat/sh#380)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants