看啥推荐读物
专栏名称: 生信媛
生信媛,从1人分享,到8人同行。坚持分享生信入门方法与课程,持续记录生信相关的分析pipeline, python和R在生物信息学中的利用。内容涵盖服务器使用、基因组转录组分析以及群体遗传。
今天看啥  ›  专栏  ›  生信媛

什么,你嫌Python跑得慢?

生信媛  · 公众号  · 生物  · 2017-12-01 19:17
Speed Up Your ScriptsWhy so slow?Python is a interpreted advanced compute language, run with cpython 's Interpreter, no like compiled language such as C++ et al. Python 's Global Interpreter Lock(GIL).In CPython, the global interpreter lock, or GIL, is a mutex that prevents multiple native threads from executing Python bytecodes at once. This lock is necessary mainly because CPython’s memory management is not thread-safe. (However, since the GIL exists, other features have grown to depend on the guarantees that it enforces.)简单说,Python作为解释型高级编程语言,需要在运行时动态分配内存,这消耗一定时间,并且还有全局解释锁(Global interpreter Lock,GIL),玩不了原生的多线程。--By 日更翻译Some good ways to speed your scriptsto be more pythonic, using standard library such as numpy, scipy, pandas  using speed up mod ………………………………

原文地址:访问原文地址
快照地址: 访问文章快照