[Crossfire-wiki] [Crossfire DokuWiki] page changed: dev_todo:performance_improvements

no-reply_wiki at metalforge.org no-reply_wiki at metalforge.org
Fri Sep 22 12:59:33 CDT 2006


A page in your DokuWiki was added or changed. Here are the details:



Date        : 2006/09/22 12:59

User        : 

Edit Summary: Fix stupid mistakes and add potential fixes.



@@ -2,6 +2,10 @@

  ===== 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_p
ut_more to be ran 2.43e18 (20!) times. Meteor swarm often inserts more tha
n 50 effects, which would mean over 3.04e64 runs of that inner loop.

- 

+     * 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_p
ut_more to be ran 210 times. A few casts if meteor swarm often insert more
 than 50 effects per tile, covering an area around 20x20 tiles, which woul
d result in it having to go through the inside of the loop of that functio
n well over 510000 times. If there is enough meteor swarms cast to create 
100 flame objects per tile (not uncommon), it has to go 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 th
e child one disappears, it reduces the damage, when all childs diappear, t
he parent spell effect object disappears. Make it so when inserting spell 
effects, merge ones with identical face/name/level/attacktype together int
o 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_ty
pe" use 'and' logic as opposed to the current 'or' logic.





IP-Address  : 192.139.27.18

Old Revision: http://wiki.metalforge.net/doku.php/dev_todo:performance_imp
rovements?rev=1158942579

New Revision: http://wiki.metalforge.net/doku.php/dev_todo:performance_imp
rovements



-- 

This mail was generated by DokuWiki at

http://wiki.metalforge.net/





More information about the crossfire-wiki mailing list