2 ms·
The reason that performance-oriented languages like C++ and Rust make a distinction there is to make it easier for someone reading the code to understand the pe
by kibwen 8y ago
The reason that performance-oriented languages like C++ and Rust make a distinction there is to make it easier for someone reading the code to understand the performance implications of a piece of code. Accessing a field involves jumping to a statically-known offset, which is a minor and predictable cost, whereas calling a function could have any cost imaginable. It's reasonable for languages that prioritize ergonomics over extreme performance to make the decision to paper over that distinction.