#这个是 Python 性能快速优化的
使用 Map ,Reduce 和 Filter 代替 for 循环
校验 a in b, 字典 或 set 比 列表 或 元组 更好
当数据量大的时候,尽可能使用不可变数据类型,他们更快 元组 > 列表
在一个列表中插入数据的复杂度为 O(n)
如果你需要操作列表的两端,使用 deque
del - 删除对象使用如下
1) python 自己处理它,但确保使用了 gc 模块
2) 编写 del 函数
3) 最简单的方式,使用后调用 del
time.clock()
Last active
July 6, 2018 09:25
-
-
Save Roger8/2475b64c1a8e80360e9962880be9be65 to your computer and use it in GitHub Desktop.
#这个是 Python 性能快速优化的
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment