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

Asynchronous Windows named pipes #311

Merged
merged 3 commits into from
Nov 19, 2018
Merged

Asynchronous Windows named pipes #311

merged 3 commits into from
Nov 19, 2018

Conversation

pyscripter
Copy link
Contributor

Non blocking poll. 1000 times faster than current implementation. 40% faster than sockets for local connections.

Non blocking poll.   1000 times faster than current implementation.  40% faster than sockets for local connections.
Also converted safe imports of mscvrt and ssl to delayed imports.
There is no need to import modules that in many use cased will not be needed.
Planning to do the same for remaining safe_imports
Avoid importing PyWin32 modules, even with safe_import, when they are not used.

Tested all with Python 2.7, 3,6, 3.7.   All work fine.  I am done with this PR.
@pyscripter
Copy link
Contributor Author

Tested all with Python 2.7, 3,6, 3.7. All work fine. I am done with this PR.

@coldfix
Copy link
Contributor

coldfix commented Nov 18, 2018

Hey, awesome, thanks!

I will merge without the last commit (while it might be slightly better in terms of import times, I don't think it's very idiomatic and worth the benefit).

@pyscripter
Copy link
Contributor Author

pyscripter commented Nov 19, 2018

I am fine with that. Just for the record the main benefit of removing the safe-imports is not to improve import times but to avoid importing modules that are not used altogether. For example a broken pywin32 installation could make rpyc unusable. safe-import still imports the module if it is available. PyWin32 modules are Windows dlls that are unnecessary loaded into the python process.

@coldfix
Copy link
Contributor

coldfix commented Nov 19, 2018

I see. In the long-term, I think this should be solved by better separation of imports (i.e. putting this class and its import dependencies in a separate module that is imported by the user directly), or lazy imports (if python ever supports it natively, or maybe by patching the safe_import function to perform lazy importing.

@coldfix coldfix merged commit 925174b into tomerfiliba-org:master Nov 19, 2018
@pyscripter
Copy link
Contributor Author

by patching the safe_import function to perform lazy importing.
I was thinking about that...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants