string compile time constants (internalized-strings) , literals can compared ==, assigned same reference @ compile-time if equal somehow.
does mean compiling code consisting of n string literals takes n log(n) time compile?
i ask question here because might know answer , i'm not can write test measures effect in reliable, reproducable or significant way. or test reflect real world constrains etc..
i'm going publish test cases can come though, feel free suggest some, implement them can find time.
do string constants/literals in code slow down compiling considerably?
no.
string compile time constants (internalized-strings) , literals can compared ==, assigned same reference @ compile-time if equal somehow.
no aren't. pooled @ compile time constants area of .class file, , interned @ class-loading time, when reference assigned.
does mean compiling code consisting of n string literals takes n log(n) time compile?
no. there no inherently o(n log(n)) process here. pooling o(1) via hash table in sensible implementation, , interning ditto.
[it of course possible construct compiler or intern()
method o(n log(n)), or o(n^3) or worse, isn't entailed in question.]
Comments
Post a Comment