I thought that if you don't request the code, it isn't loaded. Can you explain what you mean? Would it be that even though the feature isn't use'd, it's still intertwined enough to have effects? | [reply] [d/l] |
Would it be that even though the feature isn't use'd, it's still intertwined enough to have effects?
It's that I suggested it would be good to measure.
Many perl features exact a cost even for code that doesn't use them. Eg.
- Threads: I recall reading somewhere that building with threads cost something like 7% for code that made no use of them.
- Unicode: The presence of the code to deal with unicode, means at the very least a lot of extra boolean checks in code paths for code that doesn't use it.
- Tie: The ability to tie variables means passing through checks for its presence for almost every variable access.
- Many other kinds of magic impose similar complexities on code that doesn't use it; just to determine that it isn't used.
Individually, none of them are hugely detrimental, but combine them all together and the affects on every opcode that has to go through is-it-unicode, is-it-tied, is-it-lvalue, is-it-shared, is-it-someother-magic, add up.
Whether this has any such consequences was the question. shmem may be right that this is purely a syntactic sugar thing; recognised entirely at compile time; that compiles to identical code to the normal deref; and thus has no runtime consequences at all.
But your numbers above seem to indicate there may be more to it than that.
| [reply] |
Thanks BrowserUK, I plan to do much more testing solely so I can see for myself, but the comments on my post here have inspired me to run much more rigorous tests similar to this on platforms dedicated to only that, just to see.
| [reply] |
| [reply] [d/l] |