xp-framework / compiler

Compiles future PHP to today's PHP.
19 stars 0 forks source link

Remove Result::$stack #177

Closed thekid closed 11 months ago

thekid commented 11 months ago

Use local variables for backing up and restoring locals. There is no usecase where we need to access locals two or more levels above the current locals, which is what we would need the stack for.

Slight performance / memory usage improvements

Before:

Test cases:  952 succeeded, 8 skipped
Memory used: 11839.18 kB (11893.41 kB peak)
Time taken:  0.155 seconds (0.230 seconds overall)

After:

Test cases:  952 succeeded, 8 skipped
Memory used: 11832.96 kB (11887.19 kB peak)
Time taken:  0.143 seconds (0.210 seconds overall)