So I need help with mod performance

Post Reply
oddguy117
Member
Posts: 23
Joined: Thu Nov 07, 2019 19:08

So I need help with mod performance

by oddguy117 » Post

Please don't mind, that I post so many topics.

So I have the problem, that my PC doesn't handle mobs so good. If I'm near a lot of mobs, my frame rate drops. My CPU utilization is also pretty high.

Code: Select all

Values below show absolute/relative times spend per server step by the instrumented function.
A total of 1597 samples were taken


 instrumentation                                         |    min µs |    max µs |    avg µs | min % | max % | avg %
-------------------------------------------------------- | --------- | --------- | --------- | ----- | ----- | ------
 mesecons_torch:                                         |         0 |      1087 |         4 |   0.0 |  14.8 |   0.1
  - ABM[1] ............................................  |        22 |      1087 |        78 |   0.0 |  14.8 |   1.0
 flowers:                                                |         0 |       528 |         1 |   0.0 |  14.4 |   0.0
  - ABM 'Flower spread' ...............................  |       139 |       528 |       246 |   0.9 |  14.4 |   4.6
 anvil:                                                  |         0 |        25 |         0 |   0.0 |   0.0 |   0.0
  - LBM 'anvil:anvil_item_restoration' ................  |        25 |        25 |        25 |   0.0 |   0.0 |   0.0
 airtanks:                                               |         2 |      3007 |         9 |   0.0 |  32.7 |   0.1
  - playerevent[1] ....................................  |         2 |      3007 |         9 |   0.0 |  32.7 |   0.1
 hunger_ng:                                              |         6 |     10276 |       216 |   0.0 |  67.2 |   4.2
  - globalstep[1] .....................................  |         4 |      1495 |        50 |   0.0 |  42.0 |   1.5
  - on_joinplayer[1] ..................................  |        71 |        71 |        71 |   0.1 |   0.1 |   0.1
  - globalstep[2] .....................................  |         2 |     10237 |       165 |   0.0 |  66.8 |   2.7
 mesecons_detector:                                      |         0 |      2012 |         8 |   0.0 |  14.4 |   0.1
  - ABM[3] ............................................  |        20 |       316 |        47 |   0.0 |   6.6 |   0.6
  - ABM[1] ............................................  |        10 |      1984 |        86 |   0.0 |  13.5 |   0.7
 mobs_mc:                                                |       550 |     58069 |      4041 |   0.6 |  96.3 |  42.6
  - ABM 'mobs_mc:creeper spawning' ....................  |       168 |      3926 |      1044 |   2.3 |  51.8 |  13.8
  - on_step[8] ........................................  |        40 |     26340 |       405 |   0.1 |  65.7 |   4.2
  - ABM 'mobs_mc:donkey spawning' .....................  |       615 |       615 |       615 |  12.7 |  12.7 |  12.7
  - ABM 'mobs_mc:chicken spawning' ....................  |       367 |       367 |       367 |   4.6 |   4.6 |   4.6
  - ABM 'mobs_mc:baby_zombie spawning' ................  |       119 |       119 |       119 |   0.5 |   0.5 |   0.5
  - on_activate[78] ...................................  |        52 |       119 |        79 |   0.2 |   0.5 |   0.3
  - get_staticdata[19] ................................  |        15 |      7607 |       760 |   0.0 |  27.2 |   3.4
  - get_staticdata[49] ................................  |        15 |       174 |        95 |   0.2 |   2.3 |   1.1
  - ABM 'mobs_mc:enderman spawning' ...................  |       182 |      1075 |       673 |   1.6 |  16.6 |   8.5
  - on_activate[9] ....................................  |        62 |       903 |       308 |   0.2 |   3.2 |   1.2
  - on_step[7] ........................................  |        18 |      7935 |       144 |   0.0 |  66.2 |   1.7
  - ABM 'mobs_mc:slime_small spawning' ................  |       382 |      1849 |      1145 |   4.6 |  22.2 |  14.5
  - ABM 'mobs_mc:rabbit spawning' .....................  |      1560 |      1560 |      1560 |  24.7 |  24.7 |  24.7
  - ABM 'mobs_mc:zombie spawning' .....................  |      1003 |      1813 |      1408 |  14.9 |  28.6 |  21.7
  - ABM 'mobs_mc:slime_tiny spawning' .................  |       154 |       276 |       215 |   1.4 |   2.9 |   2.2
  - on_activate[12] ...................................  |        42 |       549 |       163 |   0.3 |   1.4 |   0.7
  - ABM 'mobs_mc:slime_big spawning' ..................  |       193 |      7106 |      2533 |   1.7 |  30.1 |  12.1
  - on_activate[58] ...................................  |        60 |       204 |       132 |   0.2 |   0.3 |   0.3
  - on_step[52] .......................................  |        25 |     19366 |       185 |   0.0 |  52.5 |   1.9
  - ABM 'mobs_mc:sheep spawning' ......................  |       147 |       147 |       147 |   0.6 |   0.6 |   0.6
  - ABM 'mobs_mc:pigman spawning' .....................  |       125 |      2192 |       945 |   2.3 |  13.2 |   7.3
  - on_activate[54] ...................................  |        53 |        53 |        53 |   0.1 |   0.1 |   0.1
  - ABM 'mobs_mc:wolf spawning' .......................  |      1218 |      5698 |      2748 |   6.2 |  49.4 |  26.9
  - ABM 'mobs_mc:skeleton spawning' ...................  |       370 |       697 |       491 |   5.7 |   9.1 |   6.8
  - on_step[13] .......................................  |        44 |     29025 |       396 |   0.2 |  82.8 |   4.2
  - get_staticdata[16] ................................  |        15 |     12440 |      1868 |   0.0 |  51.6 |   7.4
  - ABM 'mobs_mc:pig spawning' ........................  |      1247 |      3290 |      2268 |   6.2 |  14.1 |  10.2
  - on_activate[24] ...................................  |       314 |       642 |       478 |   0.5 |   2.7 |   1.6
  - ABM 'mobs_mc:bat spawning' ........................  |       386 |     16586 |      5507 |   1.9 |  62.3 |  18.4
  - ABM 'mobs_mc:spider spawning' .....................  |       108 |      1868 |       712 |   1.2 |   2.6 |   1.8
  - get_staticdata[2] .................................  |        15 |      5885 |       726 |   0.1 |  18.3 |   3.3
  - on_activate[20] ...................................  |       114 |      1554 |       426 |   0.3 |   2.6 |   1.3
  - on_step[21] .......................................  |        25 |     13510 |       239 |   0.0 |  67.4 |   2.3
  - on_activate[66] ...................................  |        50 |       104 |        77 |   0.4 |   1.2 |   0.8
  - on_activate[6] ....................................  |        90 |      7737 |      1649 |   0.2 |  13.1 |   3.1
  - get_staticdata[1] .................................  |        15 |       276 |       145 |   0.1 |   0.5 |   0.3
  - on_step[58] .......................................  |         7 |      5900 |        48 |   0.0 |  68.3 |   0.6
  - get_staticdata[7] .................................  |        15 |      1098 |       366 |   0.0 |   4.4 |   1.6
  - on_activate[2] ....................................  |        63 |       372 |       149 |   0.1 |   1.6 |   0.7
  - on_step[10] .......................................  |        66 |     27596 |       527 |   0.0 |  74.6 |   5.3
  - on_step[5] ........................................  |        40 |     17690 |       422 |   0.1 |  74.5 |   4.4
  - on_step[53] .......................................  |         8 |      6396 |        87 |   0.0 |  64.3 |   1.1
  - on_activate[59] ...................................  |        80 |       138 |       111 |   0.2 |   0.5 |   0.3
  - on_activate[1] ....................................  |       162 |       162 |       162 |   0.3 |   0.3 |   0.3
  - get_staticdata[44] ................................  |        14 |      8357 |      1779 |   0.1 |  11.7 |   2.7
  - ABM 'mobs_mc:horse spawning' ......................  |       838 |       838 |       838 |  12.4 |  12.4 |  12.4
  - on_step[19] .......................................  |        89 |     25279 |       666 |   0.1 |  78.8 |   7.6
  - get_staticdata[5] .................................  |        15 |      1357 |       312 |   0.0 |   6.8 |   1.3
  - get_staticdata[40] ................................  |        90 |        90 |        90 |   0.2 |   0.2 |   0.2
  - on_step[4] ........................................  |         4 |      9373 |        41 |   0.0 |  30.1 |   0.4
  - on_step[64] .......................................  |         9 |     23533 |       100 |   0.0 |  73.0 |   1.1
  - on_step[22] .......................................  |        48 |     21545 |       584 |   0.1 |  77.1 |   6.8
  - get_staticdata[4] .................................  |        15 |       309 |       174 |   0.0 |   0.8 |   0.5
  - get_staticdata[43] ................................  |        23 |       327 |       178 |   0.3 |   0.7 |   0.5
  - on_activate[41] ...................................  |        51 |        80 |        65 |   0.1 |   0.9 |   0.5
  - get_staticdata[18] ................................  |        15 |       529 |       139 |   0.1 |   0.9 |   0.4
  - get_staticdata[55] ................................  |        15 |       327 |       146 |   0.0 |   1.7 |   0.6
  - on_activate[26] ...................................  |        52 |      7997 |       846 |   0.3 |  13.5 |   2.0
  - on_activate[5] ....................................  |        82 |       162 |       122 |   0.3 |   0.3 |   0.3
  - get_staticdata[28] ................................  |        15 |      8563 |      2902 |   0.1 |  14.5 |   5.3
  - on_step[33] .......................................  |         8 |      8167 |        52 |   0.0 |  57.7 |   0.6
  - on_step[49] .......................................  |         8 |     56533 |        87 |   0.0 |  93.0 |   0.6
  - get_staticdata[10] ................................  |        16 |      6170 |       814 |   0.1 |  10.4 |   2.1
 wieldview:                                              |         1 |      5784 |         9 |   0.0 |  32.9 |   0.4
  - globalstep[1] .....................................  |         1 |      5784 |         9 |   0.0 |  32.9 |   0.4
  - on_joinplayer[1] ..................................  |         8 |         8 |         8 |   0.0 |   0.0 |   0.0
 commoditymarket:                                        |         1 |       117 |         3 |   0.0 |  44.3 |   0.3
  - globalstep[1] .....................................  |         1 |       117 |         3 |   0.0 |  44.3 |   0.3
 walking_light:                                          |         2 |     65796 |       234 |   0.0 |  83.0 |   3.6
  - globalstep[1] .....................................  |         2 |     65796 |       233 |   0.0 |  83.0 |   3.6
  - on_joinplayer[1] ..................................  |       109 |       109 |       109 |   0.1 |   0.1 |   0.1
 weather:                                                |         0 |       127 |         0 |   0.0 |   0.1 |   0.0
  - on_joinplayer[1] ..................................  |       127 |       127 |       127 |   0.1 |   0.1 |   0.1
 binoculars:                                             |         0 |       292 |         0 |   0.0 |   0.2 |   0.0
  - on_joinplayer[1] ..................................  |       292 |       292 |       292 |   0.2 |   0.2 |   0.2
 *builtin*:                                              |         2 |    197386 |       514 |   0.1 |  99.9 |   3.9
  - globalstep[1] .....................................  |         2 |     87739 |        82 |   0.0 |  99.9 |   0.7
  - on_prejoinplayer[1] ...............................  |     26295 |     26295 |     26295 |  91.4 |  91.4 |  91.4
  - on_joinplayer[2] ..................................  |    120756 |    120756 |    120756 |  96.9 |  96.9 |  96.9
  - on_joinplayer[1] ..................................  |         9 |         9 |         9 |   0.0 |   0.0 |   0.0
  - /grantme ..........................................  |     98362 |     98362 |     98362 |  48.8 |  48.8 |  48.8
  - on_chat_message[1] ................................  |       241 |     98954 |     20811 |   1.1 |  49.1 |  20.0
  - /profiler .........................................  |         8 |      1656 |       658 |   0.1 |  16.6 |   6.8
  - playerevent[1] ....................................  |        49 |     13443 |       234 |   0.0 |  42.0 |   3.2
 orienteering:                                           |         2 |     20851 |       872 |   0.0 |  91.2 |  13.7
  - globalstep[1] .....................................  |         2 |     20851 |       872 |   0.0 |  91.2 |  13.7
  - on_joinplayer[1] ..................................  |       178 |       178 |       178 |   0.1 |   0.1 |   0.1
 skinsdb:                                                |         0 |       159 |         0 |   0.0 |   0.1 |   0.0
  - on_joinplayer[1] ..................................  |       159 |       159 |       159 |   0.1 |   0.1 |   0.1
 map:                                                    |         0 |         3 |         0 |   0.0 |   0.0 |   0.0
  - on_joinplayer[1] ..................................  |         3 |         3 |         3 |   0.0 |   0.0 |   0.0
 *profiler*:                                             |         5 |      7770 |        99 |   0.0 |  64.8 |   4.9
  - Sampler (update stats) ............................  |         3 |      7766 |        92 |   0.0 |  64.0 |   4.5
  - Instrumentation overhead ..........................  |         1 |      2837 |         6 |   0.0 |  34.1 |   0.4
 mesecons:                                               |         4 |     32784 |        45 |   0.0 |  72.0 |   1.3
  - globalstep[1] .....................................  |         2 |     32781 |        41 |   0.0 |  72.0 |   1.0
  - globalstep[2] .....................................  |         2 |        93 |         4 |   0.0 |  32.0 |   0.4
 farming:                                                |         0 |       717 |         1 |   0.0 |   7.5 |   0.0
  - ABM[2] ............................................  |       244 |       717 |       470 |   0.9 |   7.5 |   4.0
 maidroid:                                               |        45 |     50629 |       830 |   0.0 |  92.2 |   5.7
  - on_step[14] .......................................  |        28 |     50607 |       784 |   0.0 |  92.1 |   4.9
  - on_activate[1] ....................................  |        24 |        24 |        24 |   0.0 |   0.0 |   0.0
  - get_staticdata[13] ................................  |       251 |       251 |       251 |   0.4 |   0.4 |   0.4
  - on_activate[14] ...................................  |       964 |       964 |       964 |   1.6 |   1.6 |   1.6
  - on_step[1] ........................................  |        10 |      6512 |        45 |   0.0 |  58.7 |   0.8
 hangglider:                                             |         0 |       186 |         0 |   0.0 |   0.1 |   0.0
  - on_joinplayer[1] ..................................  |       186 |       186 |       186 |   0.1 |   0.1 |   0.1
 forceload:                                              |         2 |      2611 |         5 |   0.0 |  43.2 |   0.4
  - globalstep[1] .....................................  |         2 |      2611 |         5 |   0.0 |  43.2 |   0.4
 3d_armor:                                               |         4 |      5826 |        16 |   0.0 |  50.5 |   0.9
  - globalstep[1] .....................................  |         2 |      1227 |         5 |   0.0 |  44.1 |   0.5
  - on_joinplayer[1] ..................................  |        25 |        25 |        25 |   0.0 |   0.0 |   0.0
  - globalstep[2] .....................................  |         2 |      5822 |        10 |   0.0 |  50.4 |   0.4
 ??:                                                     |         0 |      1183 |         0 |   0.0 |   0.9 |   0.0
  - on_joinplayer[1] ..................................  |      1183 |      1183 |      1183 |   0.9 |   0.9 |   0.9
 fire:                                                   |         1 |       873 |         9 |   0.0 |  60.8 |   0.5
  - globalstep[1] .....................................  |         1 |       873 |         9 |   0.0 |  60.8 |   0.5
 player_api:                                             |         2 |      3125 |        21 |   0.0 |  40.2 |   0.8
  - globalstep[1] .....................................  |         2 |      3125 |        21 |   0.0 |  40.2 |   0.8
  - on_joinplayer[1] ..................................  |        39 |        39 |        39 |   0.0 |   0.0 |   0.0
 sfinv:                                                  |         0 |       768 |         0 |   0.0 |   0.6 |   0.0
  - on_joinplayer[1] ..................................  |       768 |       768 |       768 |   0.6 |   0.6 |   0.6
 connected_chests:                                       |         0 |        20 |         0 |   0.0 |   0.0 |   0.0
  - ...cted Chest fixer default:chest_connected_right'   |        10 |        10 |        10 |   0.0 |   0.0 |   0.0
  - ...ected Chest fixer default:chest_connected_left'   |        10 |        12 |        11 |   0.0 |   0.0 |   0.0
 ts_furniture:                                           |         3 |      7403 |        10 |   0.0 |  40.9 |   0.5
  - globalstep[1] .....................................  |         3 |      7403 |        10 |   0.0 |  40.9 |   0.5
 factory:                                                |         3 |     21887 |        99 |   0.0 |  80.3 |   1.7
  - globalstep[1] .....................................  |         3 |      5589 |        29 |   0.0 |  80.3 |   1.1
  - ABM[9] ............................................  |        10 |       325 |        21 |   0.0 |   4.3 |   0.3
  - ABM[2] ............................................  |        50 |     12369 |       231 |   0.1 |  52.4 |   1.8
  - ABM[6] ............................................  |        58 |       183 |       139 |   0.4 |   0.9 |   0.6
  - ABM[1] ............................................  |        54 |       852 |       112 |   0.1 |  14.4 |   1.5
  - ABM[3] ............................................  |       135 |     17461 |       622 |   0.2 |  61.0 |   5.3
  - ABM[12] ...........................................  |        35 |     21536 |       376 |   0.1 |  40.5 |   1.6
 controls:                                               |         2 |      2712 |        22 |   0.0 |  48.1 |   0.8
  - globalstep[1] .....................................  |         2 |      2712 |        22 |   0.0 |  48.1 |   0.8
  - on_joinplayer[1] ..................................  |        26 |        26 |        26 |   0.0 |   0.0 |   0.0
 builtin_item:                                           |       396 |     24949 |      1547 |   0.9 |  88.7 |  21.0
  - on_activate[1] ....................................  |       179 |      7589 |      1905 |   1.7 |  12.8 |   5.6
  - on_step[1] ........................................  |       396 |     24949 |      1540 |   0.9 |  88.7 |  21.0
  - get_staticdata[1] .................................  |        32 |       530 |       190 |   0.1 |   2.6 |   1.0
 env_sounds:                                             |         0 |       166 |         0 |   0.0 |   0.1 |   0.0
  - on_joinplayer[1] ..................................  |       166 |       166 |       166 |   0.1 |   0.1 |   0.1
 default:                                                |         0 |     19242 |        40 |   0.0 |  63.0 |   0.3
  - ABM 'Grass spread' ................................  |       285 |      1810 |       635 |   1.5 |  22.5 |   8.1
  - on_joinplayer[1] ..................................  |       159 |       159 |       159 |   0.1 |   0.1 |   0.1
  - ABM 'Grass covered' ...............................  |      1041 |     19242 |      4483 |   4.4 |  63.0 |  26.4
-------------------------------------------------------- | --------- | --------- | --------- | ----- | ----- | ------
 total:                                                  |        84 |    201529 |      7954 | 100.0 | 100.0 | 100.0

So does anybody know how to fix that issue? I use mobs_redo and mobs_mc.
Probaly noone knows the particular issue, but hopefully sb knows what could be causing this problem (Trough experience with other mobs mods like mobs_animals or trough experience with mobs_redo or just knowing what often makes such issues.)

Thanks in advance
oddguy 117

User avatar
Festus1965
Member
Posts: 1286
Joined: Sun Jan 03, 2016 11:58
In-game: Thomas Explorer Thailand
Location: Thailand - Chiang Mai (+5-6h to MEZ)
Contact:

Re: So I need help with mod performance

by Festus1965 » Post

I see:
mobs_mc: with 42% off all mods
but mobs_mc is not Mobs_redo ???

oddguy117
Member
Posts: 23
Joined: Thu Nov 07, 2019 19:08

Re: So I need help with mod performance

by oddguy117 » Post

No, but the problem is the spawning, that is computed by mobs_redo. The spawning is only called by mobs_mc

User avatar
FreeGamers
Member
Posts: 608
Joined: Sat May 25, 2019 00:15
GitHub: is proprietary I use NotABug
Location: United States
Contact:

Re: So I need help with mod performance

by FreeGamers » Post

mobs_mc causes a lot of processing because it has several mobs such as a creeper that spawn anywhere in the game. So the abm's on those groups are very intense. It is better to use more specific spawn parameters.

group:cracky, crumbly, etc, apply anywhere and call a lot of processing on nodes. I've been meaning to improve this in my own server. Increase timers, lower spawn chance, limit entitys, but primary have more efficient node definitions help the most.

How did you generate this table by the way? I'd like to see a similar print out for my server to optimize things more.

oddguy117
Member
Posts: 23
Joined: Thu Nov 07, 2019 19:08

Re: So I need help with mod performance

by oddguy117 » Post

just type

Code: Select all

/profiler
in chat and you will see the options (There's one, which writes the information to a file (Should be in the world directory))

User avatar
FreeGamers
Member
Posts: 608
Joined: Sat May 25, 2019 00:15
GitHub: is proprietary I use NotABug
Location: United States
Contact:

Re: So I need help with mod performance

by FreeGamers » Post

That must be a client feature because I get no output on my server when I use that chatcommand.

User avatar
sorcerykid
Member
Posts: 1313
Joined: Fri Aug 26, 2016 15:36
GitHub: sorcerykid
In-game: Nemo
Location: Illinois, USA

Re: So I need help with mod performance

by sorcerykid » Post

You can always use my Stopwatch mod to benchmark specific portions of code in order to isolate potential bottlenecks.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests