relative slow speed of SimPy execution..
Gautam Thaker <gthaker <at> comcast.net>
2009-03-13 02:45:11 GMT
I write a lot of simulations, and I need to run many of them for hours and
hours. Thus, the base efficiency of the simulation engine matters a great deal
to me. I just learned about SimPy today, and decided to give it a go. I am
able to run the "bank" examples and I modified the bank08.py to run for
100,000 customer arrivals. I eliminated all printfs; the program took
23 seconds to run using SimPy
I then ran the same "/M/M/1" system (again w/ 100,000 arrivals) based on
www.mesquite.com's CSIM simulation env. CSIM is very old and seems very
similar to SimPy, it provides the "process" abstraction. The same basic
amount of work took:
0.26 seconds to run using CSIM v19.
Thus, the run time ratio is about 100:1. I have attached both the programs as
well as output from CSIM program, in case of interest.
SimPy looks very promising, but something either I am doing wrong or this much
efficiency is too much to give up.
Comments?
Gautam
C++/CSIM Simulation Report (Version 19.1 for Linux x86)
M/M/1 Queue
Thu Mar 12 22:42:02 2009
Ending simulation time: 1192396.201
Elapsed simulation time: 1192396.201
CPU time used (seconds): 0.250
FACILITY SUMMARY
facility service service through- queue response compl
name disc time util. put length time count
--------------------------------------------------------------------------------
facility fcfs 9.99739 0.838 0.08386 5.47438 65.27635 100000
TABLE 1: resp tms
minimum 0.000463 mean 65.276348
maximum 694.352128 variance 5140.753024
range 694.351665 standard deviation 71.699045
observations 100000 coefficient of var 1.098392
QTABLE 1: num in sys
initial 0 minimum 0 mean 5.474384
final 0 maximum 56 variance 42.258465
entries 100000 range 56 standard deviation 6.500651
exits 100000 coeff of variation 1.187467
cumulative
number total time proportion proportion
0 192656.91183 0.161571 0.161571 ******************
1 160203.46487 0.134354 0.295925 ***************
2 134077.66485 0.112444 0.408369 *************
3 113543.70852 0.095223 0.503592 ***********
4 94977.81825 0.079653 0.583245 *********
5 78717.04430 0.066016 0.649261 *******
6 66516.75458 0.055784 0.705045 ******
7 55090.95031 0.046202 0.751247 *****
8 45696.63312 0.038323 0.789571 ****
9 38585.32541 0.032359 0.821930 ****
>= 10 212329.92487 0.178070 1.000000 ********************
M/M/1 Theoretical Results
Inter-arrival time = 12.000
Service time = 10.000
Utilization = 0.833
Throughput rate = 0.083
Mn nbr at queue = 5.000
Mn queue length = 4.167
Response time = 60.000
Time in queue = 50.000
CSIM MODEL STATISTICS
CPU time used (sec): 0.250
Events processed: 383983
Memory allocated: 34060 bytes
Calls to malloc: 138
Processes
Started: 100001
Saved: 229699
Terminated: 100000
High water mark: 57
Stacks
Allocated: 100001
High water mark: 2284 words
Average: 40 words
Maximum: 44 words
Current: 44 words
------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Simpy-users mailing list
Simpy-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/simpy-users