Skip to main content

Memoization

To improve the performance of the Semver library, you can register memoization functions using Semver.setMemoizationFunc. Memoization functions registered with this function cache the results of Version.parse or VersionReq.parse, which can prevent repeated parsing of semver strings.

💡 Tip:
Memoization functions can be found in the luau-caching-and-memoization repository.

Example:​

Semver.setMemoizationFunc("Version", memoizeFrame)
Semver.setMemoizationFunc("VersionReq", function(parseFunc)
return memoizeRecentlyUsed(50, parseFunc)
end)