Lazy evaluation of overview info
Callgrind showed recalc_mapseen was three times more expensive (in terms of instructions read) than anything else in our codebase. It was being called in every vision change, re-evaluating the last seen map terrain type for every map location in sight. Remove updating the lastseen info in the vision code, and make a small change so newsym() uses update_lastseentyp. From my short tests, this seems to work correctly ...
This commit is contained in:
@@ -828,6 +828,7 @@ extern int dooverview(void);
|
||||
extern void show_overview(int, int);
|
||||
extern void rm_mapseen(int);
|
||||
extern void init_mapseen(d_level *) NONNULLARG1;
|
||||
extern void update_lastseentyp(coordxy, coordxy);
|
||||
extern void recalc_mapseen(void);
|
||||
extern void mapseen_temple(struct monst *);
|
||||
extern void room_discovered(int);
|
||||
|
||||
Reference in New Issue
Block a user