Optimize /castfocus using superwow and memoization and Co-optimize /cast as well via memoization#1610
Open
dsidirop wants to merge 6 commits intoshagu:masterfrom
Conversation
…fUI.api.RunOOC() to resolve some static-analysis warnings about var-names
…ich is meant to be used in order to memoize lua-func-strings passed on to various spell-casting utilities in the next few commits (/pfcast, /castfocus etc)
…STFOCUS() just like we did with SlashCmdList.PFFOCUS
…alls in _G.SlashCmdList.PFCAST() and SlashCmdList.PFCASTFOCUS() with pfUI.api.TryMemoizedFuncLoadstringForSpellCasts() to enjoy better runtime performance when the user passes a lua-func-string
This file contains hidden or 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
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.
This allows us to employ unit-guid-targeting to side-step the complex target-swapping tricks we would resort to when superwow wasn't available.
This is a much more care-free and lightweight approach.
As an added bonus this commit also adds seamless support for passing actual raw functions to SlashCmdList.PFCASTFOCUS() ala:
This is extremely useful for advanced pure-lua macros (p.e. via SuperMacro) as it simplifies the invocation-style tremendously.
Old was: Before this commit we would have to write this kind of stuff as a string
This was both 10x slower and was extremely cumbersome and error-prone for the user if he wanted to pass some variable-state inside the string-func-callback (god help him in that case!)