File: testmem.py

package info (click to toggle)
python-ruamel.ordereddict 0.4.9-1~bpo8%2B1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-backports
  • size: 376 kB
  • sloc: ansic: 3,678; python: 1,530; makefile: 3
file content (27 lines) | stat: -rw-r--r-- 527 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

import sys
import string
from _ordereddict import ordereddict

def do_empty():
    d = ordereddict()

def do_small():
    d = ordereddict()
    for i in range(5):
        d[i]  = i

def do_one():
    d = ordereddict()
    index = 0
    for ch1 in string.lowercase:
        for ch2 in string.lowercase:
            for ch3 in string.lowercase:
                d[ch1 + ch2] = index
                index += 1

for i in range(1000000):
    if i % 100 == 0:
        print '\r %8d' % ( i ),
        sys.stdout.flush()
    do_one()