diff options
author | Neil Moore <neil@s-z.org> | 2012-07-04 14:51:25 -0400 |
---|---|---|
committer | Neil Moore <neil@s-z.org> | 2012-07-04 15:18:07 -0400 |
commit | 957b2ec75df10225ebc91a7acb02b228d7bed7c4 (patch) | |
tree | 11648e1601299862273e8668d716805d906ce8f2 /crawl-ref/source/abyss.h | |
parent | b7d6d954c1125fc99f127d14d37f9549f31e9e82 (diff) | |
download | crawl-ref-957b2ec75df10225ebc91a7acb02b228d7bed7c4.tar.gz crawl-ref-957b2ec75df10225ebc91a7acb02b228d7bed7c4.zip |
Cut abyss CPU usage greatly.
Memoize the feature computed for a cell in the previous turn, rather
than computing it twice per turn. This allows us to preserve digging
etc. in the abyss without the doubled CPU usage introduced by
0.10-a0-3040-ga00d525. On my (somewhat slow) machine, the time for a
1000-turn run of the abyss stress test is reduced from ~85 s to ~55 s.
Currently we recompute the cache (i.e., run the worley routines on each
map cell) when loading a saved game and when the abyss shifts as a
result of hitting the map edge. The last case could be avoided by shifting
around features in the cached array, but abyss shifts are infrequent
enough that this is probably not necessary.
Diffstat (limited to 'crawl-ref/source/abyss.h')
-rw-r--r-- | crawl-ref/source/abyss.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/crawl-ref/source/abyss.h b/crawl-ref/source/abyss.h index e8f010841d..5f1bfbce85 100644 --- a/crawl-ref/source/abyss.h +++ b/crawl-ref/source/abyss.h @@ -23,6 +23,7 @@ void abyss_morph(double duration); void push_features_to_abyss(); void generate_abyss(); +void recompute_saved_abyss_features(); void maybe_shift_abyss_around_player(); void abyss_teleport(bool new_area); void save_abyss_uniques(); |