by ashish_negi_ · 4y ago · 0 comments
Does deference means accessing a field of object ? Does alias/dealias mean creating/destroying another variable reference ?
If answer of above is true, isn't programs deference more than alias/dealias ? i mean, in:
var alias = shared_ptr_of_some_object; for (int i = 0; i < 1000; ++i) { alias.foo += bar_fn(alias.baz) }
is just creating 1 alias but defrences 1k times and above looks like very typical code.
That statement is referring to our sample program, a roguelike game that we use for benchmarking. As for why this is the case, I'm not sure! I suspect its because a lot of classes will alias/dealias objects without ever dereferencing them, such as List<T>, HashMap<T>, etc.