A* path and neighbor cache performance statistics

as_clear_cachepath() now prints cache hits, misses, number of entries,
and memory use to stderr, when compiled with AS_STATS defined.
This commit is contained in:
Markus Armbruster 2011-02-19 13:19:27 +01:00
parent 8f92fe40f4
commit 2797e58c20
2 changed files with 43 additions and 1 deletions

View file

@ -120,6 +120,8 @@ best_path(struct sctstr *from, struct sctstr *to, char *path, int mob_type)
#ifdef AS_STATS
as_stats(adp, stderr);
fprintf(stderr, "neighbor cache %zu bytes\n",
WORLD_SZ() * 6 * sizeof(struct sctstr *));
#endif /* AS_STATS */
return 0;
}