update: Reorder sector production for speed

The update visits sectors in increasing order of country number.
Within a country, it visits in increasing order of sector number,
which is effectively top to bottom, left to right, starting with
absolute 0,0.

The order doesn't actually matter.  Before Chainsaw's option BUDGET,
the update simply visited the sectors in sector number order.  Go back
to that order, because it's faster.  For the update, it's a few
percent in my testing.  For budget, it's more than a third.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
Markus Armbruster 2016-07-13 22:02:40 +02:00
parent c5df505c98
commit 5a548c9901
12 changed files with 132 additions and 127 deletions

View file

@ -146,7 +146,7 @@ extern double buildeff(struct sctstr *);
extern void do_fallout(struct sctstr *, int);
extern void spread_fallout(struct sctstr *, int);
extern void decay_fallout(struct sctstr *, int);
extern void produce_sect(struct natstr *, int, struct bp *);
extern void produce_sect(int, struct bp *);
/* ship.c */
extern void prep_ships(int);
extern void prod_ship(int, struct bp *, int);