#46487: actions.c: Reduce repetitive action_id_get_target_kind() use Open Date: 2023-01-08 08:33 Last Update: 2023-01-11 02:18 URL for this Ticket: https://osdn.net//projects/freeciv/ticket/46487 RSS feed for this Ticket: https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=46487 --------------------------------------------------------------------- Last Changes/Comment on this Ticket: 2023-01-11 02:18 Updated by: cazfi * Owner Update from (None) to cazfi * Resolution Update from None to Accepted * Milestone Update from (None) to 3.0.6 --------------------------------------------------------------------- Ticket Status: Reporter: cazfi Owner: cazfi Type: Patches Status: Open [Owner assigned] Priority: 5 - Medium MileStone: 3.0.6 Component: General Severity: 5 - Medium Resolution: Accepted --------------------------------------------------------------------- Ticket details: Looking at S3_0. Not sure (not looked in details) if compiler has any chance to deduct that action_id_get_target_kind() calls can be skipped (no side-effects, always returns the same target kind for the same action id), but likely not. This causes at least function call overhead, and may hinder optimization pass in general. E.g. action in the beginning of is_action_possible() calls action_id_get_target_kind(wanted_action) five times, and more follow in non-assert code. -- Ticket information of Freeciv project Freeciv Project is hosted on OSDN Project URL: https://osdn.net/projects/freeciv/ OSDN: https://osdn.net URL for this Ticket: https://osdn.net/projects/freeciv/ticket/46487 RSS feed for this Ticket: https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=46487