User Tools

Site Tools


dev_todo:performance_improvements

Performance Improvements

Spells

Meteor Swarm

  • A few casts of meteor swarm can slow down a server for a bit
  • Slowdown profiled to mainly be in ok_to_put_more() in spell_util.c
    • ok_to_put_more() must transverse all objects on a square. Placing 20 spell effects on one square, requires the inside of the loop in ok_to_put_more to be ran 210 times. A few casts if meteor swarm often insert more than 50 effects per tile, covering an area around 20×20 tiles, which would result in it having to go through the inside of the loop of that function well over 510000 times. If there is enough meteor swarms cast to create 100 flame objects per tile (not uncommon), it has to go through the inside of that loop over 2020000 times.
    • Two issues to fix, either would help alot though the first is more important:
      • Too many flame objects are inserted
        • Perhaps make a new 'spell effect container' type, which adopts the attacktype/name/face/level of spell effect objects inside of it, when a new spell effect is inserted into it, increases the damage, and when the child one disappears, it reduces the damage, when all childs diappear, the parent spell effect object disappears. Make it so when inserting spell effects, merge ones with identical face/name/level/attacktype together into a 'spell effect container'
      • ok_to_put_more() trasversing too many objects
        • Could be fixed by making a new movement type “move_spell” and making it so spells used that to move, and counterspell effects would use that. For this to work, one would need to add a flag, which makes “move_type” use 'and' logic as opposed to the current 'or' logic.
dev_todo/performance_improvements.txt · Last modified: 2006/09/22 13:01 (external edit)