Limits
255 registers per function · 32 767 instructions per function · 32 value slots per slice element · 255 script-visible fields per component (checked when the component is registered) · call depth 256 · 1 000 000 instructions per call into a script (configurable).
Run it:
package demo
import "aego/log"
func depth(n int) int {
if n == 0 {
return 0
}
return 1 + depth(n - 1)
}
script Limits {
var frames int
var sum int
func Ready() {
log.Info("recursion " + string(depth(200)) + " deep, below the limit of 256")
}
func Update(dt float) {
for i := 0; i < 20_000; i++ {
sum += i % 7
}
frames++
if frames % 60 == 0 {
log.Info("frame " + string(frames) + ": 20 000 iterations per frame fit the budget, sum " + string(sum))
}
}
}