일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
- play2 강좌
- CORDA
- hyperledger fabric
- 안드로이드 웹뷰
- 스위프트
- 하이브리드앱
- Golang
- 블록체인
- 파이썬 데이터분석
- 스칼라
- 주키퍼
- Hyperledger fabric gossip protocol
- 하이퍼레저 패브릭
- Actor
- 파이썬
- 파이썬 동시성
- 파이썬 머신러닝
- Play2
- Play2 로 웹 개발
- 엔터프라이즈 블록체인
- 이더리움
- 스칼라 강좌
- Adapter 패턴
- 스칼라 동시성
- play 강좌
- 플레이프레임워크
- 그라파나
- akka 강좌
- Akka
- 파이썬 강좌
- Today
- Total
HAMA 블로그
파이썬 최고 성능을 위한 프로젝트 본문
파이썬 최고 성능을 위한 프로젝트들
흠 표준 파이썬은 아무래도 조금 느립니다, 그래서 성능을 최대로 올리기위한 여러 방법이 있긴 합니다..
고성능 파이썬이란 책도 사놓고 조금 읽긴했는데 파이썬 쓰면서 성능때문에 신경 쓸 빠에는..생각해보면
그럴바엔 그냥 C++ 쓸거 같긴하네요. 그냥 표준 파이썬 (CPython) + Async + 병렬,분산으로 최대한 쇼부봐야..
원문은 아래 링크에 있습니다. 번역 예정..
http://www.infoworld.com/article/2880767/python/5-projects-push-python-performance.html
PyPy
Among the candidates for a drop-in replacement for CPython, PyPy is easily the most visible (Quora, for instance, uses it in production). It also stands the best chance of becoming the default, as it's highly compatible with existing Python code.
PyPy uses just-in-time (JIT) compilation, the same technique used by Google Chrome's V8 JavaScript engine to speed up that language. The most recent release, PyPy 2.5, emerged at the beginning of February with a slew of performance improvements, among them better-integrated support for some common libraries used to accelerate Python performance such as NumPy.
Those using Python 3.x have to work with a separate build of the project, PyPy3. Unfortunately for lovers of bleeding-edge language features, that version supports up to Python 3.2.5 only, although support for 3.3 is in the works.
Pyston
Pyston, sponsored by Dropbox, uses the LLVM compiler infrastructure to also speed up Python with JITing. Compared to PyPy, Pyston is in the very early stages -- it's at revision 0.2 so far and supports only a limited subset of the language's features. Much of the work has been divided between supporting core features of the language and bringing up performance of key benchmarks to an acceptable level. It'll be a while before Pyston can be considered remotely production-ready.
Nuitka
Rather than replace the Python runtime, some teams are doing away with a Python runtime entirely and seeking ways to transpile Python code to languages that run natively at high speed. Case in point: Nuitka, which converts Python to C++ code -- although it relies on executables from the existing Python runtimes to work its magic. That limits its portability, but there's no denying the value of the velocity gained from this conversion. Long-term plans for Nuitka include allowing Nuitka-compiled Python to interface directly with C code, allowing for even greater speed.
Cython
Cython (C extensions for Python) is a superset of Python, a version of the language that compiles to C and interfaces with C/C++ code. It's one way to write C extensions for Python (where code that needs to run fast can be implemented), but can also be used on its own, separate from conventional Python code. The downside is that you're not really writing Python, so porting existing code wouldn't be totally automatic.
That said, Cython provides several advantages for the sake of speed not available in vanilla Python, among them variable typing à la C itself. A number of scientific packages for Python, such as scikit-learn, draw on Cython features like this to keep operations lean and fast.
Numba
Numba combines two of the previous approaches. From Cython, it takes the concept of speeding up the parts of the language that most need it (typically CPU-bound math); like PyPy and Pyston, it does so via LLVM. Functions compiled with Numba can be specified with a decorator, and Numba works hand-in-hand with NumPy to quicken the functions found. However, Numba doesn't perform JITing; the code is compiled ahead of time.
Python creator Guido van Rossum is adamant that many of Python's performance issues can be traced to improper use of the language. CPU-heavy processing, for instance, can be hastened through a few methods touched on here -- using NumPy (for math), using the multiprocessing extensions, or making calls to external C code and thus avoiding the Global Interpreter Lock (GIL), the root of Python's slowness. But since there's no viable replacement yet for the GIL in Python, it falls to others to come up with short-term solutions -- and maybe long-term ones, too.
'Python' 카테고리의 다른 글
파이썬으로 클라우드 (병렬,분산) 하고 싶어요 (0) | 2016.09.14 |
---|---|
파이썬의 함정 - 2 (@classmethod 와 @staticmethod 의 차이) (1) | 2016.09.13 |
파이썬의 함정 - 1 (클래스변수 와 객체 변수) (0) | 2016.09.11 |
Python, Numpy, SciPy, Matplotlib 설치 (0) | 2016.02.05 |
Scala 과 Python 를 동시에 배워보자. (0) | 2015.05.04 |