forked from slayergod13/slashdiablo-maphack
-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Item name and map action cache #40
Merged
planqi
merged 31 commits into
planqi:master
from
youbetterdont:feature/get-item-name-cache-2
Mar 17, 2020
Merged
Item name and map action cache #40
planqi
merged 31 commits into
planqi:master
from
youbetterdont:feature/get-item-name-cache-2
Mar 17, 2020
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Google testing framework added. Tests refactored
Travis config added
Simple reproduction of the bug: LRUCache<string, string> lruCache(3); lruCache.put("key1", "val1"); lruCache.put("key2", "val2"); lruCache.put("key3", "val3"); lruCache.put("key1", lruCache.get("key1")); The get returns a ref to the value of "key1", the put gets the ref and invalidate it when it finds "key1" already exists in the cache.
Fix use after free
Similar name of cache instance and cache namespace in tests caused the error: redeclared as different kind of symbol.
Fix redeclared as different kind of symbol issue
Fix wrong namespace name in comment
…en possible, bypassing the call to evaluate. * The item name cache uses the unmodified item name in addition to the modified one. This allows for detecting changes in the unmodified item name. This is used to trigger updates to the modified item name. * PrintText will now truncate the string instead of crashing when it's too long.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Here is the profiler result after the name cache implementation:
Here's the callstack for Evaluate:
The dominant evaluate calls are coming from OnAutoMap draw now rather than GetItemName.
FYI, I left on a print statement that fires whenever a change is detected to the unmodified item name. This is what I use to trigger cache updates. You'll see it go off when IDing items, making runewords, etc. The reason I left it on is that I want to know if it ever fires in other situations, like if you leave an item on the ground and come back to it after a long time. I don't think this is harmful (since it's detected afterall), but it's just interesting to know.
I pulled in an LRU cache implementation as a subtree. That's what a lot of these commits are. It's a header only library, so you'll just need to modify your include path if using the Visual Studio project. The cmake files have already been udpated.
This PR includes the previous performance related PRs.
Sleepy files:
capture_chaos_run_item_name_cache.zip
TODO:
Reset cache when reloading config file. I think that the item names won't update when the config is refreshed until the cache happens to get full of other stuff.Remove the 'Reset LRU cache' message that prints when joining games.Update 3/12:
Performance after the map cache:
Sleepy:
capture_chaos_after_map_rule_fix.zip
No BH functions are visible at the top anymore!
Notes:
50100. Least recently used items are removed first.Update 3/17: