Pyhon性能优化--日积月累
摘要:1. 减少函数调用次数num1 = 9if type(num1) == type(0): pass2这里调用了两次获取类型的函数。修改为:import typesif type(num1) == types.IntType: pass2. 对象身份比较性能高于值比较。import typ...
阅读全文
posted @ 2014-12-13 01:03
posted @ 2014-12-13 01:03
posted @ 2014-12-12 22:26
posted @ 2014-11-26 22:36