-
Notifications
You must be signed in to change notification settings - Fork 271
Closed
Labels
bugclaimedIssue is being actively worked on.Issue is being actively worked on.documentation neededMissing, out-of-date or bad documentationMissing, out-of-date or bad documentationfeatureAdding functionality that adds valueAdding functionality that adds valuemacro changesThis issue adds or changes macro functions. Extra work is required (testing, wiki, code editor)This issue adds or changes macro functions. Extra work is required (testing, wiki, code editor)performanceA performance or quality of life improvementA performance or quality of life improvementrefactorRefactoring the code for optimal awesomeness.Refactoring the code for optimal awesomeness.
Description
Describe the Bug
When adding 3200 elements to a new table using setTableEntry(), MT can consume significant cpu and even more memory (upwards of 48GB!).
To Reproduce
Execute the follow macro and note the execution time. Then comment out or delete the setTableEntry() and run it again.
[h: pattern = "Dex"]
[h: replaceWith = "DEX"]
[h: tableName = "Beasts"]
[h: stringIndex = "40"]
[h, COUNT(3200), CODE:
{
[h: stringList = table(tableName, roll.count)]
[h: value = listGet(stringList, stringIndex, "~")]
[h: value = replace(value, pattern, replaceWith)]
[h: stringList = listReplace(stringList, stringIndex, value, "~")]
[h: setTableEntry(tableName, roll.count, stringList)]
}
]
Expected Behaviour
The setTableEntry() function should overwrite an existing entry if it's there, or add a new one if it isn't. (The latter is new functionality that doesn't exist in the current version, so the wiki will need to be updated.) Unfortunately, I don't see a way to change the return code so that it can indicate whether an entry was added or replaced and still maintain backward compatibility.
Screenshots
No response
MapTool Info
All
Desktop
Any
Additional Context
See this Discord discussion for the initial report from Full Bleed.
Metadata
Metadata
Assignees
Labels
bugclaimedIssue is being actively worked on.Issue is being actively worked on.documentation neededMissing, out-of-date or bad documentationMissing, out-of-date or bad documentationfeatureAdding functionality that adds valueAdding functionality that adds valuemacro changesThis issue adds or changes macro functions. Extra work is required (testing, wiki, code editor)This issue adds or changes macro functions. Extra work is required (testing, wiki, code editor)performanceA performance or quality of life improvementA performance or quality of life improvementrefactorRefactoring the code for optimal awesomeness.Refactoring the code for optimal awesomeness.
Type
Projects
Status
Merged