I improved Nginx::Var access on ngx_mruby's next branch by defining methods on first access. Callgrind's var scenario used ~16% fewer instructions than the previous next version, excluding GC. For v3, not yet released.
https://github.com/matsumotory/ngx_mruby/pull/610
GitHubNginx::Var: define accessors at their first use, and read the variables of Connection, Server and Request in C by matsumotory · Pull Request #610 · matsumotory/ngx_mrubySummary Implements the proposal for the method lookup of Nginx::Var accessors (#577) as the owner decided it: candidate (a) with the rule (a2), and candidate (d). The owner answered the question of...
commit 1d8e577