3 ms·
I have recently heard people saying Python is too slow and Java is preferred for some thing. Since I'm a bit of a newbie in the python world I'm not sure what t
by j2d2 18y ago
I have recently heard people saying Python is too slow and Java is preferred for some thing. Since I'm a bit of a newbie in the python world I'm not sure what to suggest.
Do y'all have an opinion on this?
- etal 18y agoThe main thing that Python users complain about in CPython is the global interpreter lock, which restricts all the threads in a Python process to one CPU. (Ruby has this too.) So concurrency over multiple CPUs has steadily become more of a concern over the years. Stackless came up with a solution, but Guido shot it down, and it appears be surviving somewhat in parallel. (No pun intended.) Jython gets rid of the GIL and uses native threads like Java, and is scheduled to come out of its half-decade coma sometime this year. The mainline CPython implementors insist that getting rid of the GIL would cause infinite headache, but they're offering a reasonable substitute in Python 2.6: the multiprocessing module, which has a thread-like API but uses separate OS processes behind the scenes. So, I don't think there will be a mutiny over this.
- BrandonM 18y agoI watch the python-ideas mailing list and there has been some talk recently of bringing some of the micro-threading ideas from Twisted into the CPython implementation itself. I don't have much knowledge of micro-threads or Twisted so I haven't been following the conversation very closely, but at least that's another data point in the state of parallelism in Python.