3 ms·
I attempted to describe the progress I've made with PyParallel already here: https://mail.python.org/pipermail/python-ideas/2015-June/034342.html https://mail.p
by trentnelson 11y ago
I attempted to describe the progress I've made with PyParallel already here: https://mail.python.org/pipermail/python-ideas/2015-June/034342.html https://mail.python.org/pipermail/python-ideas/2015-June/034...
And here: https://mail.python.org/pipermail/python-ideas/2015-June/034260.html https://mail.python.org/pipermail/python-ideas/2015-June/034...
I'm getting excellent scaling and performance across the board for the simple TEFB tests (https://bitbucket.org/tpn/pyparallel/src/8528b11ba51003a9821ceb75683ee96ed33db28a/examples/tefb/tefb.py?at=3.3-px https://bitbucket.org/tpn/pyparallel/src/8528b11ba51003a9821...), and have implemented something that really shows where PyParallel shines: an instantaneous wiki search REST API: https://bitbucket.org/tpn/pyparallel/src/8528b11ba51003a9821ceb75683ee96ed33db28a/examples/wiki/wiki.py?at=3.3-px https://bitbucket.org/tpn/pyparallel/src/8528b11ba51003a9821....
Quoting:
I particularly like the wiki example as it leverages a lot of benefits afforded by PyParallel's approach to parallelism, concurrency and asynchronous I/O:
- Load a digital search trie (datrie.Trie) that contains every
Wikipedia title and the byte-offset within the wiki.xml where
the title was found. (Once loaded the RSS of python.exe is about
11GB; the trie itself has about 16 million items in it.)
- Load a numpy array of sorted 64-bit integer offsets. This allows
us to do a searchsorted() (binary search) against a given offset
in order to derive the next offset.
- Once we have a way of getting two byte offsets, we can use ranged
HTTP requests (and TransmitFile behind the scenes) to efficiently
read random chunks of the file asynchronously. (Windows has a
huge advantage here -- there's simply no way to achieve similar
functionality on POSIX in a non-blocking fashion (sendfile can
block, a disk read() can block, a memory reference into a mmap'd
file that isn't in memory will page fault, which will block).)
- scott_s 11y agoApparently, you should expect to hear from him soon: https://mail.python.org/pipermail/python-ideas/2015-June/034275.html https://mail.python.org/pipermail/python-ideas/2015-June/034... Antoine Pitrou said that Snow's proposal was similar to your work. What do you see as the similarities?
- trentnelson 11y agoI cover that in the other e-mail I quoted. The similarity is simply focusing on solving the problem with a single process and threads versus multiple processes via fork(). I don't agree with the subinterpreter approach. In fact, my opinion is that the best way to solve the problem is to use the approach taken by PyParallel. Granted, I would think that wouldn't I, being the author of PyParallel and all ;-)