Skip to content

gaojiahua/python_PERF_OPT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tips

目录

一. python性能分析

1. 运行时间

  • Shell 命令time
  • Python模块time
  • Python模块cProfile
  • Python模块line_profiler

2. 内存占用

  • 内存占用memory_profiler

  • 内存泄漏objgraph

3. 可视化工具与日志分析

  • Runsnakerun
  • pycallgraph

二. python 性能优化技巧

1. 少造轮子

  • 二分查找
  • 排序

2. 使用效率更高的语法

  • 字符串连接
  • range和xrange
  • 推导式
  • 循环优化
  • 生成器

3. python脚本运行方式

  • Cython
  • Pypy

三. python 性能优化实践

1. 真假多线程

2. json解析

3. url中提取域名

4. simhash算法



About

python performance optimization

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published