Login

MOVONET

Home Music Blog Group Champion Forum Club

Login | Sign Up| Help

Category:business circle/entertainment circle   Owner python    Members' Amount:11People   Group Status: Public    Create Date:2006-12-31  
  • Related list memory release small skill   python time
  • Posted by python
  • 2007-09-21 18:34:20 
     Also had period of time with python, had many experiences.Usually always writes the request efficiency very high procedure, discovered python very is really good.But regarding the ultra big list data, the memory needs to release immediately frequently.I summarized some related performance skill, has a look everybody to be able to use.

1。Great data quantity list, must carry on the partial element to delete, avoids as far as possible with the del stochastic deletion, affects the performance extremely, if the deletion quantity is very big, was inferior direct newly built list, then releases clear spatial old list with following method.

2。Regarding general data quantity ultra big list, the fast clear spatial release memory, may = [] release directly with a.A is list.

3。Regarding took the function parameter list, with above method is not good, after because the function carries out, the list length is invariable, but may like this release parameter list in the function to occupy the memory: del a[:], the speed is very quick, also thorough:

MOKI-COUNT :0 | Views1474 | Comments3
  Comments
  • IP :
  • How do like Caixing   
  • 2009-10-01 16:36:17
  • IP :
  • I discovered not good, del a[:] cannot solve the problem!!!   
  • 2009-02-19 10:56:54
  • IP :
  •   
  • 2007-12-14 23:20:25

Verification: 8+0=