Page MenuHomeFeedback Tracker

SQF Expression Global Variable Instruction Performance Enhancement
Acknowledged, WishlistPublic

Description

Currently compiled SQF global variable value get/set instructions include a look up of the variable in the namespaces global variable table. Since instructions are unique to the compiled code instruction list it would make sense to do this lookup initially in the constructor for the instruction and then store a reference to that global variable instead, so that the execute method is just referencing the reference instead of having to do a slow namespace search, that, often times is very repetitive.

Considerations that would have to be made is that global variables would essentially be pre-allocated, even if they are never used, though this seems like it would be minimal overhead as the GameValue objects contain just a pointer to the actual data (which is dynamically allocated and freed). Some changes in deleting/nilling out variables would also need to be made, the checks changing to see if the stored value pointer is null instead of if the name exists or not.

I believe that this change would fundamentally increase the performance of SQF dramatically with very little time investment in the actual code changes.

Changes to local variable access could also be made in a similar fashion through better stack allocation algorithms, but I have not investigated this fully.

Details

Legacy ID
2344435461
Severity
None
Resolution
Open
Reproducibility
Always
Operating System
Windows 7
Category
Performance

Event Timeline

Nou set Category to Performance.Aug 11 2015, 6:24 AM
Nou set Reproducibility to Always.
Nou set Severity to None.
Nou set Resolution to Open.
Nou set Legacy ID to 2344435461.May 8 2016, 12:30 PM
Nou edited a custom field.
dedmen added a subscriber: dedmen.Sep 13 2017, 1:45 PM

Related to https://feedback.bistudio.com/T123419 Though my proposal is easier to implement.

dedmen closed this task as Resolved.Sep 26 2023, 2:17 PM
This comment was removed by dedmen.
dedmen reopened this task as New.Sep 26 2023, 2:18 PM
dedmen updated the task description. (Show Details)
dedmen set Operating System to Windows 7.
dedmen removed Dwarden as the assignee of this task.Sep 26 2023, 2:24 PM
dedmen changed the task status from New to Acknowledged.
dedmen set Ref Ticket to AIII-56003.