"Normal" usage of variables is O(1). There is no run-time searching of stacks or symbol tables or anything like that. Cases that might go slower include:
- referring to a variable via a character vector containing its name, e.g. ⎕NC'foo'. This has to search a symbol table.
- using the same name in different namespaces, e.g. referring to both ns1.foo and ns2.foo. The last namespace a name was seen in is cached; on a cache miss we have to search a symbol table. This also applies to OO-heavy code, which almost inevitably switches into different namespaces all over the place.