Talk:Team Fortress 2/Scripting/Script Functions/Constants: Difference between revisions
(Create talk page, explain changes more detailed.) |
No edit summary |
||
Line 16: | Line 16: | ||
--[[User:AvastAntiPony9445|AvastAntiPony9445]] ([[User talk:AvastAntiPony9445|talk]]) 12:15, 8 October 2025 (PDT) | --[[User:AvastAntiPony9445|AvastAntiPony9445]] ([[User talk:AvastAntiPony9445|talk]]) 12:15, 8 October 2025 (PDT) | ||
: See this article: https://developer.valvesoftware.com/wiki/User:Braindawg/performance | |||
: --[[User:Ficool2|Ficool2]] ([[User talk:Ficool2|talk]]) 08:46, 9 October 2025 (PDT) |
Latest revision as of 08:46, 9 October 2025
Premature optimizations
I've decided to change a warning into a tip, rephrase some of the tips and mark the article for clean up due to premature optimization being considered the root of all evil.
The warning were making it seem very critical and impactful, but unless someone is doing expensive code, the difference in performance is often negligible.
However, since there's no Squirrel/VScript article for optimizations (that I've been able to find) I've decided to keep the code there, until it may be moved.
If you wish to check out some of the performance differences yourself, you may paste the following commands in to the console with an active map.
script "local test = 0; for (local i = 0; i < 0x7FFFF; ++i) {test += Constants.FContents.CONTENTS_SOLID}"
script "::root_test <- Constants.FContents.CONTENTS_SOLID; local test = 0; for (local i = 0; i < 0x7FFFF; ++i) {test += ::root_test}"
script "local local_test = Constants.FContents.CONTENTS_SOLID; local test = 0; for (local i = 0; i < 0x7FFFF; ++i) {test += local_test}"
--AvastAntiPony9445 (talk) 12:15, 8 October 2025 (PDT)
- See this article: https://developer.valvesoftware.com/wiki/User:Braindawg/performance
- --Ficool2 (talk) 08:46, 9 October 2025 (PDT)