URL:
<http://gna.org/patch/?7985>
Summary: Optimise autoattack transport depth check
Project: Freeciv
Submitted by: jtn
Submitted on: Sun 13 Nov 2016 02:10:31 PM UTC
Category: None
Priority: 5 - Normal
Status: In Progress
Privacy: Public
Assigned to: jtn
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Planned Release: 2.5.6, 2.6.0, 3.0.0
Contains string changes: No
_______________________________________________________
Details:
From my comment in bug #25259:
> A simple optimisation for speed would be to only call unit_transport_depth()
once on each unit.
> Another fiddlier saving (that may not be worth the hassle) would be to
iterate over both transporter stacks in parallel, and bail out when the top of
either one is hit; this saves iterations in the common case where cargo is
compared against non-cargo. Otherwise, if there's a deep nested transport
stack in a stack, we walk its list ~(n log n) times for every defender that
stack could attack.
I haven't measured the improvement (if any), only tested that it doesn't cause
regressions.
_______________________________________________________
Reply to this item at:
<http://gna.org/patch/?7985>
_______________________________________________
Message sent via/by Gna!
http://gna.org/
_______________________________________________
Freeciv-dev mailing list
[email protected]
https://mail.gna.org/listinfo/freeciv-dev