Skip to content

Instantly share code, notes, and snippets.

@laserbat
Created July 2, 2011 08:28
Show Gist options
  • Save laserbat/1059857 to your computer and use it in GitHub Desktop.
Save laserbat/1059857 to your computer and use it in GitHub Desktop.
22377185 function calls (20756598 primitive calls) in 102.934 CPU seconds
Ordered by: cumulative time
ncalls tottime percall cumtime percall filename:lineno(function)
1 0.000 0.000 102.934 102.934 {execfile}
1 0.001 0.001 102.934 102.934 main.py:20(<module>)
1 1.296 1.296 102.909 102.909 Game.py:65(main_loop)
750 0.235 0.000 50.794 0.068 Game.py:651(playerTurn)
272 6.107 0.022 32.549 0.120 Game.py:275(drawmap)
1078 0.004 0.000 30.777 0.029 unicurses.py:2246(getch)
1078 0.004 0.000 30.773 0.029 unicurses.py:1147(wgetch)
1078 30.769 0.029 30.769 0.029 {built-in method getch}
1502801/2518 8.262 0.000 24.560 0.010 copy.py:144(deepcopy)
100825/61 1.473 0.000 21.927 0.359 copy.py:224(_deepcopy_list)
133295/125982 1.726 0.000 21.601 0.000 copy.py:277(_deepcopy_inst)
328 0.004 0.000 19.783 0.060 IO.py:83(readkey)
138209/125982 2.319 0.000 15.966 0.000 copy.py:251(_deepcopy_dict)
369986 3.514 0.000 14.465 0.000 IO.py:65(printex)
750 0.011 0.000 11.039 0.015 IO.py:98(rkey)
123284 1.451 0.000 8.093 0.000 Game.py:482(inLos)
302 0.008 0.000 8.035 0.027 fov.py:36(fieldOfView)
1208 0.361 0.000 8.026 0.007 fov.py:162(__checkQuadrant)
95460 1.195 0.000 7.522 0.000 fov.py:206(__visitCoord)
123284 3.959 0.000 6.642 0.000 Game.py:439(get_line)
652803 1.678 0.000 4.267 0.000 unicurses.py:2242(attroff)
424850 1.196 0.000 3.601 0.000 random.py:224(randint)
494096 1.282 0.000 3.295 0.000 unicurses.py:2243(attron)
2696228 3.082 0.000 3.082 0.000 {method 'append' of 'list' objects}
369986 0.997 0.000 2.962 0.000 unicurses.py:2275(mvaddstr)
974 0.017 0.000 2.933 0.003 Game.py:594(mobTurn)
732965 1.949 0.000 2.917 0.000 unicurses.py:904(color_pair)
450782 1.840 0.000 2.894 0.000 copy.py:261(_keep_alive)
2362422 2.766 0.000 2.766 0.000 {id}
525 0.003 0.000 2.756 0.005 Game.py:497(aStarPathfind)
525 0.029 0.000 2.754 0.005 AStar.py:139(getPath)
525 0.931 0.002 2.725 0.005 AStar.py:55(pathFind)
652803 1.729 0.000 2.589 0.000 unicurses.py:783(wattroff)
1958497 2.482 0.000 2.482 0.000 {method 'get' of 'dict' objects}
424850 1.912 0.000 2.404 0.000 random.py:160(randrange)
274587 1.423 0.000 2.248 0.000 fov.py:144(relativeSlope)
494096 1.348 0.000 2.014 0.000 unicurses.py:792(wattron)
369986 1.247 0.000 1.964 0.000 unicurses.py:1550(mvwaddstr)
538097 1.329 0.000 1.329 0.000 {hasattr}
870044 1.314 0.000 1.314 0.000 Game.py:1007(near)
117041 0.316 0.000 1.279 0.000 fov.py:128(pBelowOrCollinear)
4914 0.094 0.000 1.146 0.000 copy.py:300(_reconstruct)
29078 0.492 0.000 1.090 0.000 copy.py:232(_deepcopy_tuple)
732965 0.968 0.000 0.968 0.000 {_curses.color_pair}
89119 0.239 0.000 0.964 0.000 fov.py:134(pAboveOrCollinear)
652803 0.860 0.000 0.860 0.000 {built-in method attroff}
369986 0.717 0.000 0.717 0.000 {built-in method addstr}
47755 0.436 0.000 0.693 0.000 {_heapq.heappop}
494096 0.665 0.000 0.665 0.000 {built-in method attron}
25 0.046 0.002 0.516 0.021 Game.py:507(floodFill)
425836 0.494 0.000 0.494 0.000 {method 'random' of '_random.Random' objects}
25 0.272 0.011 0.470 0.019 Game.py:521(flood)
398059 0.456 0.000 0.456 0.000 {len}
369852 0.426 0.000 0.426 0.000 {abs}
274587 0.413 0.000 0.413 0.000 fov.py:122(<lambda>)
274587 0.412 0.000 0.412 0.000 fov.py:123(<lambda>)
47612 0.165 0.000 0.380 0.000 AStar.py:33(updatePriority)
246729 0.365 0.000 0.365 0.000 AStar.py:31(__lt__)
2315 0.007 0.000 0.358 0.000 unicurses.py:2250(refresh)
2315 0.009 0.000 0.350 0.000 unicurses.py:1929(wrefresh)
57616 0.233 0.000 0.342 0.000 {_heapq.heappush}
2315 0.341 0.000 0.341 0.000 {built-in method refresh}
30325 0.084 0.000 0.330 0.000 fov.py:131(pAbove)
2 0.000 0.000 0.316 0.158 Game.py:427(save)
2 0.196 0.098 0.315 0.158 {cPickle.dump}
164314 0.312 0.000 0.312 0.000 {range}
13112 0.048 0.000 0.278 0.000 fov.py:324(__checkView)
138209 0.267 0.000 0.267 0.000 {method 'iteritems' of 'dict' objects}
1 0.000 0.000 0.264 0.264 Game.py:384(askDirection)
138209 0.258 0.000 0.258 0.000 {method 'update' of 'dict' objects}
301 0.243 0.001 0.243 0.001 Game.py:364(resetFov)
21074 0.058 0.000 0.231 0.000 fov.py:125(pBelow)
47612 0.149 0.000 0.215 0.000 AStar.py:42(estimate)
13112 0.044 0.000 0.207 0.000 fov.py:140(lineCollinear)
17028 0.046 0.000 0.187 0.000 fov.py:137(pCollinear)
125507 0.183 0.000 0.183 0.000 cell.py:36(char)
5126 0.047 0.000 0.162 0.000 fov.py:308(__addSteepBump)
7986 0.056 0.000 0.159 0.000 fov.py:292(__addShallowBump)
2408 0.032 0.000 0.119 0.000 gzip.py:187(write)
59390 0.106 0.000 0.106 0.000 AStar.py:26(__init__)
74286 0.099 0.000 0.099 0.000 {min}
74286 0.098 0.000 0.098 0.000 {max}
51678 0.090 0.000 0.090 0.000 Game.py:354(isBlocking)
45599 0.086 0.000 0.086 0.000 Game.py:359(setVisible)
47087 0.085 0.000 0.085 0.000 AStar.py:36(nextMove)
1371 0.049 0.000 0.082 0.000 Game.py:993(hasSpaceAround)
66118 0.075 0.000 0.075 0.000 {method 'reverse' of 'list' objects}
2408 0.068 0.000 0.068 0.000 {built-in method compress}
47613 0.067 0.000 0.067 0.000 {math.sqrt}
45599 0.062 0.000 0.062 0.000 {method 'add' of 'set' objects}
44461 0.052 0.000 0.052 0.000 copy.py:197(_deepcopy_atomic)
4914 0.049 0.000 0.049 0.000 {method '__reduce_ex__' of 'object' objects}
55 0.036 0.001 0.036 0.001 Game.py:371(resetFlood)
14742 0.022 0.000 0.022 0.000 {isinstance}
1 0.003 0.003 0.022 0.022 Game.py:18(<module>)
13112 0.022 0.000 0.022 0.000 fov.py:149(__init__)
4914 0.014 0.000 0.021 0.000 copy_reg.py:92(__newobj__)
1 0.003 0.003 0.020 0.020 Game.py:563(spawnMobs)
9828 0.020 0.000 0.020 0.000 {getattr}
2 0.008 0.004 0.019 0.010 Level.py:46(generateLevel)
1078 0.003 0.000 0.009 0.000 unicurses.py:2255(timeout)
1 0.001 0.001 0.008 0.008 IO.py:19(<module>)
1079 0.003 0.000 0.008 0.000 unicurses.py:873(cbreak)
4914 0.008 0.000 0.008 0.000 {issubclass}
986 0.005 0.000 0.007 0.000 random.py:259(choice)
4914 0.007 0.000 0.007 0.000 {built-in method __new__ of type object at 0xb7800d20}
1 0.001 0.001 0.007 0.007 unicurses.py:19(<module>)
2416 0.007 0.000 0.007 0.000 fov.py:116(__init__)
1 0.000 0.000 0.006 0.006 Level.py:18(<module>)
750 0.002 0.000 0.006 0.000 unicurses.py:1755(nocbreak)
1 0.006 0.006 0.006 0.006 Level.py:23(levGen)
2428 0.006 0.000 0.006 0.000 {method 'write' of 'file' objects}
3865 0.006 0.000 0.006 0.000 cell.py:34(__init__)
2410 0.006 0.000 0.006 0.000 {zlib.crc32}
894 0.004 0.000 0.005 0.000 Game.py:473(moveMob)
1078 0.004 0.000 0.005 0.000 unicurses.py:2126(wtimeout)
750 0.002 0.000 0.005 0.000 unicurses.py:1243(halfdelay)
1079 0.005 0.000 0.005 0.000 {_curses.cbreak}
2457 0.004 0.000 0.004 0.000 {method 'insert' of 'list' objects}
750 0.004 0.000 0.004 0.000 {_curses.nocbreak}
1 0.003 0.003 0.004 0.004 __init__.py:4(<module>)
17 0.001 0.000 0.003 0.000 Level.py:39(hCorridor)
1043 0.003 0.000 0.003 0.000 {chr}
1 0.000 0.000 0.002 0.002 Game.py:36(__init__)
750 0.002 0.000 0.002 0.000 {_curses.halfdelay}
1 0.000 0.000 0.002 0.002 IO.py:27(__init__)
1208 0.002 0.000 0.002 0.000 fov.py:155(__init__)
1329 0.002 0.000 0.002 0.000 you.py:26(char)
1 0.000 0.000 0.002 0.002 unicurses.py:1351(initscr)
1 0.000 0.000 0.002 0.002 __init__.py:28(initscr)
1301 0.002 0.000 0.002 0.000 cell.py:76(char)
1 0.001 0.001 0.002 0.002 random.py:40(<module>)
1078 0.002 0.000 0.002 0.000 {built-in method timeout}
947 0.002 0.000 0.002 0.000 cell.py:107(char)
17 0.001 0.000 0.001 0.000 Level.py:25(createRoom)
1 0.000 0.000 0.001 0.001 AStar.py:18(<module>)
790 0.001 0.000 0.001 0.000 cell.py:49(char)
1 0.001 0.001 0.001 0.001 {_curses.initscr}
1 0.001 0.001 0.001 0.001 __init__.py:11(<module>)
17 0.000 0.000 0.001 0.000 Level.py:32(vCorridor)
1 0.001 0.001 0.001 0.001 heapq.py:31(<module>)
1 0.001 0.001 0.001 0.001 gzip.py:4(<module>)
576 0.001 0.000 0.001 0.000 {method 'pop' of 'list' objects}
1 0.001 0.001 0.001 0.001 Game.py:378(amnesia)
2 0.000 0.000 0.001 0.000 gzip.py:26(open)
2 0.000 0.000 0.001 0.000 gzip.py:323(__del__)
2 0.000 0.000 0.001 0.000 gzip.py:44(__init__)
2 0.000 0.000 0.001 0.000 gzip.py:308(close)
246 0.000 0.000 0.000 0.000 Level.py:179(intersect)
257 0.000 0.000 0.000 0.000 cell.py:135(char)
1 0.000 0.000 0.000 0.000 panel.py:4(<module>)
2 0.000 0.000 0.000 0.000 {built-in method flush}
32 0.000 0.000 0.000 0.000 unicurses.py:352(ALTCHAR)
1 0.000 0.000 0.000 0.000 {method 'items' of 'dict' objects}
3 0.000 0.000 0.000 0.000 __init__.py:78(CFUNCTYPE)
64 0.000 0.000 0.000 0.000 {ord}
1 0.000 0.000 0.000 0.000 _endian.py:4(<module>)
4 0.000 0.000 0.000 0.000 locale.py:499(setlocale)
2 0.000 0.000 0.000 0.000 {open}
2 0.000 0.000 0.000 0.000 gzip.py:133(_write_gzip_header)
4 0.000 0.000 0.000 0.000 {_locale.setlocale}
100 0.000 0.000 0.000 0.000 Level.py:168(__init__)
1 0.000 0.000 0.000 0.000 bisect.py:1(<module>)
1 0.000 0.000 0.000 0.000 unicurses.py:2222(use_default_colors)
1 0.000 0.000 0.000 0.000 genericpath.py:26(isfile)
3 0.000 0.000 0.000 0.000 __init__.py:480(PYFUNCTYPE)
1 0.000 0.000 0.000 0.000 {_curses.use_default_colors}
14 0.000 0.000 0.000 0.000 __init__.py:147(_check_size)
1 0.000 0.000 0.000 0.000 random.py:90(__init__)
1 0.000 0.000 0.000 0.000 {posix.stat}
1 0.000 0.000 0.000 0.000 random.py:99(seed)
57 0.000 0.000 0.000 0.000 cell.py:80(__init__)
2 0.000 0.000 0.000 0.000 {method 'close' of 'file' objects}
1 0.000 0.000 0.000 0.000 cell.py:18(<module>)
32 0.000 0.000 0.000 0.000 unicurses.py:343(CCHAR)
1 0.000 0.000 0.000 0.000 fov.py:32(<module>)
1 0.000 0.000 0.000 0.000 {_curses.setupterm}
9 0.000 0.000 0.000 0.000 unicurses.py:963(curs_set)
1 0.000 0.000 0.000 0.000 os.py:747(urandom)
1 0.000 0.000 0.000 0.000 unicurses.py:1466(keypad)
6 0.000 0.000 0.000 0.000 gzip.py:18(write32u)
1 0.000 0.000 0.000 0.000 {built-in method keypad}
2 0.000 0.000 0.000 0.000 {zlib.compressobj}
2 0.000 0.000 0.000 0.000 {_ctypes.POINTER}
36 0.000 0.000 0.000 0.000 Level.py:174(center)
1 0.000 0.000 0.000 0.000 unicurses.py:2025(start_color)
45 0.000 0.000 0.000 0.000 {setattr}
1 0.000 0.000 0.000 0.000 __init__.py:45(start_color)
1 0.000 0.000 0.000 0.000 __future__.py:48(<module>)
9 0.000 0.000 0.000 0.000 {_curses.curs_set}
1 0.000 0.000 0.000 0.000 __init__.py:337(__init__)
30 0.000 0.000 0.000 0.000 cell.py:54(move)
1 0.000 0.000 0.000 0.000 locale.py:544(getpreferredencoding)
1 0.000 0.000 0.000 0.000 Game.py:268(end)
34 0.000 0.000 0.000 0.000 {_ctypes.sizeof}
1 0.000 0.000 0.000 0.000 random.py:71(Random)
1 0.000 0.000 0.000 0.000 gzip.py:35(GzipFile)
18 0.000 0.000 0.000 0.000 {_struct.calcsize}
2 0.000 0.000 0.000 0.000 gzip.py:126(_init_write)
8 0.000 0.000 0.000 0.000 unicurses.py:1342(init_pair)
6 0.000 0.000 0.000 0.000 {_struct.pack}
1 0.000 0.000 0.000 0.000 {posix.open}
1 0.000 0.000 0.000 0.000 {function seed at 0x8192e64}
1 0.000 0.000 0.000 0.000 {posix.read}
1 0.000 0.000 0.000 0.000 unicurses.py:1082(endwin)
1 0.000 0.000 0.000 0.000 copy_reg.py:95(_slotnames)
1 0.000 0.000 0.000 0.000 {math.exp}
1 0.000 0.000 0.000 0.000 Game.py:35(Game)
1 0.000 0.000 0.000 0.000 {_curses.endwin}
1 0.000 0.000 0.000 0.000 UserDict.py:57(get)
8 0.000 0.000 0.000 0.000 {_curses.init_pair}
7 0.000 0.000 0.000 0.000 cell.py:95(__init__)
7 0.000 0.000 0.000 0.000 __future__.py:75(__init__)
2 0.000 0.000 0.000 0.000 unicurses.py:1773(noecho)
1 0.000 0.000 0.000 0.000 fov.py:115(__Line)
6 0.000 0.000 0.000 0.000 {method 'pop' of 'dict' objects}
6 0.000 0.000 0.000 0.000 cell.py:47(__init__)
1 0.000 0.000 0.000 0.000 you.py:17(<module>)
1 0.000 0.000 0.000 0.000 {sys.exit}
2 0.000 0.000 0.000 0.000 {math.log}
1 0.000 0.000 0.000 0.000 AStar.py:21(node)
1 0.000 0.000 0.000 0.000 {_ctypes.dlopen}
1 0.000 0.000 0.000 0.000 wrapper.py:8(<module>)
1 0.000 0.000 0.000 0.000 {_curses.start_color}
1 0.000 0.000 0.000 0.000 cell.py:59(Mob)
2 0.000 0.000 0.000 0.000 {time.time}
1 0.000 0.000 0.000 0.000 {binascii.hexlify}
3 0.000 0.000 0.000 0.000 __init__.py:104(CFunctionType)
1 0.000 0.000 0.000 0.000 random.py:793(SystemRandom)
3 0.000 0.000 0.000 0.000 cell.py:137(__init__)
1 0.000 0.000 0.000 0.000 constants.py:18(<module>)
1 0.000 0.000 0.000 0.000 __init__.py:416(LibraryLoader)
3 0.000 0.000 0.000 0.000 __init__.py:481(CFunctionType)
1 0.000 0.000 0.000 0.000 random.py:643(WichmannHill)
1 0.000 0.000 0.000 0.000 {posix.close}
1 0.000 0.000 0.000 0.000 Level.py:166(Rect)
2 0.000 0.000 0.000 0.000 {method 'endswith' of 'str' objects}
1 0.000 0.000 0.000 0.000 __future__.py:74(_Feature)
1 0.000 0.000 0.000 0.000 cell.py:20(Cell)
1 0.000 0.000 0.000 0.000 cell.py:104(close)
1 0.000 0.000 0.000 0.000 cell.py:130(Boulder)
1 0.000 0.000 0.000 0.000 cell.py:42(Stair)
1 0.000 0.000 0.000 0.000 IO.py:26(IO)
1 0.000 0.000 0.000 0.000 __init__.py:320(CDLL)
2 0.000 0.000 0.000 0.000 {_curses.noecho}
1 0.000 0.000 0.000 0.000 cell.py:92(Door)
1 0.000 0.000 0.000 0.000 __init__.py:376(PyDLL)
1 0.000 0.000 0.000 0.000 <string>:1(<module>)
1 0.000 0.000 0.000 0.000 __init__.py:243(c_char_p)
1 0.000 0.000 0.000 0.000 {_ctypes.set_conversion_mode}
2 0.000 0.000 0.000 0.000 __init__.py:417(__init__)
1 0.000 0.000 0.000 0.000 {_locale.nl_langinfo}
1 0.000 0.000 0.000 0.000 _endian.py:45(BigEndianStructure)
1 0.000 0.000 0.000 0.000 you.py:17(Player)
1 0.000 0.000 0.000 0.000 cell.py:113(secretDoor)
1 0.000 0.000 0.000 0.000 __init__.py:159(py_object)
1 0.000 0.000 0.000 0.000 __init__.py:255(c_void_p)
1 0.000 0.000 0.000 0.000 __init__.py:201(c_double)
1 0.000 0.000 0.000 0.000 __init__.py:180(c_ulong)
1 0.000 0.000 0.000 0.000 fov.py:148(__ViewBump)
1 0.000 0.000 0.000 0.000 cell.py:122(item)
1 0.000 0.000 0.000 0.000 __init__.py:176(c_long)
1 0.000 0.000 0.000 0.000 {method 'get' of 'dictproxy' objects}
1 0.000 0.000 0.000 0.000 __init__.py:278(c_wchar)
1 0.000 0.000 0.000 0.000 UserDict.py:17(__getitem__)
1 0.000 0.000 0.000 0.000 cell.py:79(Newt)
1 0.000 0.000 0.000 0.000 UserDict.py:69(__contains__)
1 0.000 0.000 0.000 0.000 __init__.py:347(_FuncPtr)
1 0.000 0.000 0.000 0.000 cell.py:71(__init__)
1 0.000 0.000 0.000 0.000 __init__.py:1(<module>)
1 0.000 0.000 0.000 0.000 cell.py:101(open)
1 0.000 0.000 0.000 0.000 fov.py:154(__View)
1 0.000 0.000 0.000 0.000 _endian.py:22(_swapped_meta)
1 0.000 0.000 0.000 0.000 you.py:24(__init__)
1 0.000 0.000 0.000 0.000 __init__.py:168(c_short)
1 0.000 0.000 0.000 0.000 __init__.py:233(c_byte)
1 0.000 0.000 0.000 0.000 IO.py:52(retSceen)
1 0.000 0.000 0.000 0.000 __init__.py:260(c_bool)
1 0.000 0.000 0.000 0.000 {method 'disable' of '_lsprof.Profiler' objects}
1 0.000 0.000 0.000 0.000 __init__.py:275(c_wchar_p)
1 0.000 0.000 0.000 0.000 {method 'fileno' of 'file' objects}
1 0.000 0.000 0.000 0.000 {method 'isalnum' of 'str' objects}
1 0.000 0.000 0.000 0.000 __init__.py:238(c_char)
1 0.000 0.000 0.000 0.000 __init__.py:205(c_longdouble)
1 0.000 0.000 0.000 0.000 __init__.py:197(c_float)
1 0.000 0.000 0.000 0.000 __init__.py:215(c_longlong)
1 0.000 0.000 0.000 0.000 __init__.py:219(c_ulonglong)
1 0.000 0.000 0.000 0.000 Game.py:574(logWrite)
1 0.000 0.000 0.000 0.000 __init__.py:172(c_ushort)
1 0.000 0.000 0.000 0.000 __init__.py:226(c_ubyte)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment