0

I 'm trying to run pymclevel (http://www.github.com/mcedit/pymclevel) in a script context where the total time the script takes to execute. Simply starting the file results in it taking a few seconds until it actually reaches the end of the script, skipping the main class. If I raise a systemexit as the last line and remove all other initialization, it still takes 3-4 seconds. The CPU isn't the problem, it's a Xeon E3-1290v2 at 3.8Ghz x 4 cores. Any help is greatly appreciated.

William
  • 570
  • 3
  • 17

1 Answers1

1

You have to understand where the bootleneck is, look at CPU, RAM and HARD-DISK usage.

i'm really confident that is a HARD-DISK realted, as far as i know minecraft map can be really big. Also if your ram can't hadle all the map it will frequently swapped to disk, causing a lot of additional computing time

Lesto
  • 2,260
  • 2
  • 19
  • 26
  • The problem is python in this case - 32 GB of ram, $900 CPU and SSD takes 4 sec to load a script with no init. – William Feb 20 '14 at 17:23
  • How much big is the map? if much less than 32GB we can't blame SSD ot RAM. Can you monitor the real CPU usage for core (like with task manager)? maybe the code is single threaded, so will use only one core of your CPU. That is a design choose of the creator and has no better solution than re-design the code. – Lesto Feb 20 '14 at 17:32
  • I modified the code to not load any map and not do anything except rise a systemexit as soon as python is ready ( replace the 10 lines to init the terminal with raise SystemExit). It's Python's load time and not what the script is doing, I expect that to take time – William Feb 20 '14 at 17:59
  • Still during this load time you should see your CPU or RAM or SSD doing something, or there are some explicit delay in code. Probabily this load time is caused by the modules, so you can try to profile the code http://docs.python.org/2/library/profile.html – Lesto Feb 20 '14 at 18:19
  • It uses numpy and a lot of include files, could that be the issue? – William Feb 20 '14 at 18:28
  • yes, and if this is the case compiling should at least mitigate the problem, see http://stackoverflow.com/questions/2010255/speeding-up-the-python-import-loader – Lesto Feb 20 '14 at 18:42