#46447: calc_activity() optimizations Open Date: 2023-01-04 09:35 Last Update: 2023-01-04 09:40 URL for this Ticket: https://osdn.net//projects/freeciv/ticket/46447 RSS feed for this Ticket: https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=46447 --------------------------------------------------------------------- Last Changes/Comment on this Ticket: 2023-01-04 09:40 Updated by: cazfi Comment: This is required for #46448, and should be implemented so that it gets enabled. --------------------------------------------------------------------- Ticket Status: Reporter: cazfi Owner: (None) Type: Patches Status: Open Priority: 5 - Medium MileStone: (None) Component: General Severity: 5 - Medium Resolution: None --------------------------------------------------------------------- Ticket details: activity_type_iterate() loop in calc_activity() does tile_activity_time() & stuff "1 + num_extras * 2" times for every activity, when it could be just 1 for activities that are not about extras, and num_extras for activities that are about them. It also memset() to zero what it had allocated with fc_calloc(), already giving zeroed memory. -- 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/46447 RSS feed for this Ticket: https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=46447