ID:2852401
 
Resolved
Several longstanding causes of poor statpanel performance have been addressed and improved.
BYOND Version:514
Operating System:Windows 10 Home 64-bit
Web Browser:Firefox 108.0
Applies to:Dream Seeker
Status: Resolved (515.1599)

This issue has been resolved.
Descriptive Problem Summary:
Stat panels in certain scenarios cause a noticeable performance/fps drop while active.

Numbered Steps to Reproduce Problem:
1. Make an updating stat panel
2. Observe performance

Code Snippet (if applicable) to Reproduce Problem:
obj
statTest4
var
wordsToStat = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent sit amet nulla vel neque euismod sagittis aliquet vitae urna. Vestibulum auctor ex a sapien vulputate sodales. Praesent id massa tincidunt, varius urna eu, blandit nulla. Quisque venenatis est ut tellus facilisis, eget accumsan nulla pellentesque. Nam condimentum lacus vel pretium efficitur. Nulla facilisi. Morbi non arcu et diam commodo bibendum. Donec neque justo, cursus in metus vitae, volutpat rhoncus nisl. Phasellus semper, nunc quis convallis rutrum, purus tortor pretium neque, vitae auctor nunc massa a libero. Maecenas bibendum lacinia magna. Proin suscipit, enim sed iaculis hendrerit, ex nibh mattis tellus, vel iaculis odio velit a sapien. Ut a arcu nec mi dignissim ornare. Nunc commodo leo vel elementum ornare. In vulputate arcu eu leo porta facilisis. Donec iaculis tincidunt nunc, a cursus sapien ornare quis. "
list/stuffToStat

New()
..()
stuffToStat = splittext(wordsToStat, " ")
var/l = list()
for(var/i = 1; i <= length(stuffToStat); i++)
var/n = rand(0, 3)
var/V = jointext(stuffToStat, " ", i, i + n + 1)
i += n
l += V
l[l[1]] = 1
stuffToStat = l

Stat()
while(StatProc())
sleep(1)

proc/StatProc()
if(statpanel(name) || !activeStatPanelCheck)
if(dormant) return 1
stat("Test4")
for(var/V in stuffToStat)
if(stuffToStat[V]) stat(V, rand(1,4))
else stat(V, 1)
return 0


Expected Results:
No loss in performance.

Actual Results:
Noticeable loss in performance.

Does the problem occur:
Every time? Or how often? Yes
In other games? Yes
In other user accounts? Yes
On other computers? Yes

When does the problem NOT occur?
When not using stat panels or using relatively light stat panels/verb panels.

Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit http://www.byond.com/download/build to download old versions for testing.)

Workarounds:
Don't use stat panels.
Lummox JR resolved issue with message:
Several longstanding causes of poor statpanel performance have been addressed and improved.