| Joel Uckelman on Mon, 3 Jan 2005 15:09:35 -0600 (CST) |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
| [nimh-dev] more format profiling |
Here's what the profiler tells me when I run my present version of scan.py:
ncalls tottime percall cumtime percall filename:lineno(function)
1 0.010 0.010 0.743 0.743 nscan.py:5(?)
1 -0.000 -0.000 0.743 0.743 profile:0(<code object ? at 0xf6d0c420, file "nscan.py", line 5>)
1 0.017 0.017 0.638 0.638 test:1(?)
1 -0.000 -0.000 0.638 0.638 Format.py:23(inst_loop)
154 0.017 0.000 0.564 0.004 Folder.py:19(openmessage)
154 0.016 0.000 0.547 0.004 Message.py:4(message_from_file)
154 0.006 0.000 0.470 0.003 __init__.py:54(message_from_file)
177/154 -0.006 -0.000 0.457 0.003 Parser.py:53(parse)
177/154 0.167 0.001 0.356 0.002 Parser.py:143(_parsebody)
44 0.008 0.000 0.160 0.004 sre_compile.py:461(compile)
These are the top 10 functions by cumulative time. Of the 0.743s that
nscan.py takes, most of that is spent in test, which is the format code.
Unfortunately, 5/6 of the time used by test is for Folder.openmessage(),
so my format code is within 0.074s of optimality. Folder.openmessage() wraps
Message.message_from_file(), and from there execution goes off into the
email module. So it looks like reducing execution time significantly would
involve implementing some of the email module ourselves. Ick.
_______________________________________________
nimh-dev mailing list
nimh-dev@xxxxxxxxxxx
http://lists.ellipsis.cx/mailman/listinfo/nimh-dev