Hello, this function is the one that consumes the most cpu
Logs:
Dispatcher
Lua
The problem was solved by removing the autoloot.
std::bind(&Game::executeDeath, &g_game, getID())
is this directly related to only sources or are they also from onDeath of creaturescripts? Consumption reaches up to 30% with 250 players. Thanks in advance!Logs:
Dispatcher
C++:
[01/03/2022 23:15:53]
Thread: 1 Cpu usage: 56.4352% Idle: 43.4241% Other: 0.140743% Players online: 177
Time (ms) Calls Rel usage % Real usage % Description
34665 3881 20.47533% 11.55529% std::bind(&Game::executeDeath, &g_game, getID())
30939 636193 18.27442% 10.31320% std::bind(&Game::checkCreatureWalk, &g_game, getID())
29949 2948 17.68934% 9.98302% std::bind(&Game::checkCreatures, this, (index + 1) % EVENT_CREATURECOUNT)
24180 121184 14.28233% 8.06026% functor
13800 103805 8.15136% 4.60024% &Game::playerSay
12542 245654 7.40819% 4.18083% std::bind(&Game::checkCreatureAttack, &g_game, getID())
7406 1190 4.37449% 2.46875% std::bind(&Game::checkDecay, this)
4253 6472 2.51257% 1.41798% std::bind(&Game::playerUseWithCreature, this, playerId, fromPos, fromStackPos, creatureId, spriteId)
4161 25253 2.45825% 1.38732% &Game::playerUseWithCreature
2533 30376 1.49658% 0.84460% &Game::playerMove
859 10876 0.50774% 0.28654% std::bind(&Spawn::scheduleSpawn, this, spawnId, sb, interval - NONBLOCKABLE_SPAWN_INTERVAL)
564 9735 0.33334% 0.18812% &Game::playerSetAttackedCreature
522 23 0.30847% 0.17409% std::bind(&ProtocolGame::login, getThis(), characterName, accountId, operatingSystem)
472 9712 0.27899% 0.15745% &Game::playerUseItem
391 238706 0.23137% 0.13057% std::bind(&Modules::executeOnRecvbyte, g_modules, player, msg, recvbyte)
336 7032 0.19905% 0.11233% &Game::playerTurn
330 29447 0.19515% 0.11013% &Game::playerReceivePingBack
212 1307 0.12530% 0.07071% &Game::playerMoveThing
184 1189 0.10919% 0.06162% std::bind(&Game::checkImbuements, this)
Lua
Lua:
[01/03/2022 23:15:53]
Time (ms) Calls Rel usage % Real usage % Description
24162 3599 27.09163% 8.05424% data/events/scripts/monster.lua:Monster@onDropLoot
10214 307074 11.45290% 3.40490% data/events/scripts/creature.lua:Creature@onTargetCombat
5798 3758 6.50142% 1.93285% data/events/scripts/player.lua:Player@onStorageUpdate
4608 9739 5.16711% 1.53616% data/npc/scripts/Hireling.lua:onCreatureAppear
4139 8480 4.64072% 1.37967% data/npc/scripts/Hireling.lua:onCreatureSay
3917 192870 4.39207% 1.30575% data/events/scripts/player.lua:Creature@onDrainHealth
2920 11955 3.27402% 0.97335% data/events/scripts/player.lua:Player@onGainExperience
2803 72612 3.14334% 0.93450% data/creaturescripts/scripts/reward_chest/boss.lua:onHealthChange
2464 79023 2.76378% 0.82166% data/events/scripts/player.lua:Player@onCombat
1811 2418 2.03130% 0.60390% data/npc/scripts/Gundralph.lua:onCreatureAppear
1787 591 2.00371% 0.59570% data/npc/scripts/Frafnar.lua:onCreatureDisappear
1410 36092 1.58115% 0.47007% data/creaturescripts/scripts/quests/the_order_of_the_lion/monster_attack.lua:onThink
1298 620 1.45603% 0.43287% data/npc/scripts/Tehlim.lua:onThink
1051 4008 1.17865% 0.35041% data/creaturescripts/scripts/custom_scripts/task_system.lua:onKill
951 531 1.06663% 0.31710% data/npc/scripts/Nokmir.lua:onThink
799 202 0.89680% 0.26661% data/npc/scripts/Tehlim.lua:onCreatureDisappear
727 34 0.81590% 0.24256% data/creaturescripts/scripts/others/advance_save.lua:onAdvance
693 34 0.77779% 0.23124% data/creaturescripts/scripts/others/reward_level.lua:onAdvance
659 3303 0.73959% 0.21988% data/npc/scripts/Djema.lua:onCreatureSay
619 61353 0.69474% 0.20654% data/events/scripts/player.lua:Player@onGainSkillTries
580 4008 0.65047% 0.19338% data/creaturescripts/scripts/quests/killing_in_the_name_of/kills.lua:onKill
482 729 0.54107% 0.16086% data/npc/scripts/Ulala.lua:onCreatureAppear
472 49386 0.52971% 0.15748% data/creaturescripts/scripts/others/pet.lua:onThink
463 2570 0.51982% 0.15454% data/npc/scripts/Edmund.lua:onCreatureAppear
453 18403 0.50815% 0.15107% data/creaturescripts/scripts/quests/the_order_of_the_lion/monster_attack.lua:onHealthChange
432 695 0.48522% 0.14425% data/npc/scripts/Hemor, The Guard.lua:onThink
432 2191 0.48518% 0.14424% data/npc/scripts/Ocelus.lua:onCreatureSay
345 72612 0.38792% 0.11533% data/creaturescripts/scripts/quests/cults_of_tibia/healLeiden.lua:onHealthChange
339 218 0.38022% 0.11304% data/events/scripts/player.lua:Player@onChangeZone
331 4008 0.37165% 0.11049% /home/otmanager/data/scripts/creaturescripts/quests/kilmaresh/fafnar.lua:callback
294 72612 0.32986% 0.09807% data/creaturescripts/scripts/quests/cults_of_tibia/pilaresHealth.lua:onHealthChange
283 72612 0.31770% 0.09445% data/creaturescripts/scripts/quests/cults_of_tibia/reflectDamage.lua:onHealthChange
245 4008 0.27475% 0.08168% data/creaturescripts/scripts/quests/killing_in_the_name_of/minos.lua:onKill
210 49386 0.23623% 0.07023% data/creaturescripts/scripts/custom_scripts/prison.lua:onThink
206 7027 0.23109% 0.06870% data/npc/scripts/Zirkon.lua:onThink
187 3626 0.21072% 0.06265% data/events/scripts/monster.lua:Monster@onSpawn
176 21 0.19765% 0.05876% data/creaturescripts/scripts/others/login.lua:onLogin
176 49389 0.19757% 0.05874% data/creaturescripts/scripts/custom_scripts/tutor_reward.lua:onThink
161 4008 0.18115% 0.05385% data/creaturescripts/scripts/quests/cults_of_tibia/destroyedPillars.lua:onKill
153 1107 0.17247% 0.05128% data/events/scripts/player.lua:Player@onMoveItem
141 4008 0.15901% 0.04727% data/creaturescripts/scripts/quests/roshamuul_quest/lowerRoshamuul.lua:onKill
138 1600 0.15525% 0.04615% data/events/scripts/party.lua:Party@onShareExperience
136 4008 0.15270% 0.04540% data/creaturescripts/scripts/quests/dangerous_depths/dwarvesTasks.lua:onKill
129 4008 0.14472% 0.04302% data/creaturescripts/scripts/quests/killing_in_the_name_of/necro.lua:onKill
128 220 0.14432% 0.04291% data/npc/scripts/Richard.lua:onCreatureAppear
109 714 0.12258% 0.03644% data/npc/scripts/A Ghostly Woman Ghostland.lua:onCreatureAppear
107 5900 0.12057% 0.03585% data/npc/scripts/Hireling.lua:onThink
104 527 0.11665% 0.03468% data/npc/scripts/Xodet.lua:onCreatureSay
103 558 0.11633% 0.03459% data/npc/scripts/Yaman.lua:onCreatureAppear
102 5013 0.11524% 0.03426% data/npc/scripts/Bank.lua:onThink
96 1588 0.10856% 0.03228% data/creaturescripts/scripts/reward_chest/boss.lua:onThink
95 4008 0.10653% 0.03167% data/creaturescripts/scripts/quests/svargrond_arena/arena_kill.lua:onKill
93 9 0.10432% 0.03101% data/creaturescripts/scripts/others/logout.lua:onLogout
92 495 0.10351% 0.03077% data/npc/scripts/default.lua:onCreatureSay
91 116 0.10296% 0.03061% data/npc/scripts/Chief Grarkharok.lua:onCreatureAppear
Post automatically merged:
The problem was solved by removing the autoloot.
Last edited: