3 ms·
I think it could be fairly profitable performance wise to write a specialized version of compareTo (simple memcmp) for cases where the result is directly compar
by vardump 9y ago
I think it could be fairly profitable performance wise to write a specialized version of compareTo (simple memcmp) for cases where the result is directly compared to 0, equal or not equal case.
Or to have compareEqualityTo() version.
Current version supports greater and less as well, which is of course useful in many data structures and sorting, but might not represent bulk of the call sites. This feature does not come for free.
This alternative version (memcmp alias) could be written to run faster.
Only benchmarking could tell whether or not it's ultimately worth it.