everydayminder

learn something everyday

Archive for March 2009

queue의 push/pop 속도 비교

leave a comment »

ㅁ Queue.Queue
   1. push(‘a’) : 6.39s
   2. push(‘a’) + pop() : 11.37s

ㅁ collections.dequeue
   1. append(‘a’) : 0.13s
   2. append(‘a’) + popleft() : 0.27s

ㅁ list
  1. append(‘a’) : 0.15s
  2. append(‘a’) + pop() : 0.40s

Queue를 쓰려면, dequeue를 활용하는 것이 좋을 것 같다.

Written by everydayminder

March 30, 2009 at 03:58

Posted in python

Tagged with , , , , ,