Skip to main content
6 events
when toggle format what by license comment
Nov 11, 2021 at 18:15 comment added sfdcfox It's circumstantial. Might be a few ms, might be a few thousand ms. It's okay in a few places, but will likely nickle-and-dime you into CPU limits if used extensively, with large data sets/low key cardinality, when debugging at FINER or FINEST, or with keys with poor hashCode/equals performance. I'd say, if you're satisfied with your code's performance, don't worry about it, but if you have been running into issues, it's at least worth profiling your maps to if it's a problem. A more comprehensive answer would need a full Q&A.
Nov 11, 2021 at 17:33 comment added Isaac L Real talk - because I've been doing it this way for the last two years - what are the real world implications here? Are we talking about adding a few ms to my execution time or is there a significant impact on performance?
Nov 10, 2021 at 15:37 comment added sfdcfox Just wandered over here because of another Q. To answer your "question", this requires 2 hashCode if the key does not exist, 3 if it does, while my solution requires 2 if the key does not exist, and 1 if it does; this means that this solution will never be more efficient than mine, and will perform worse with low cardinality (e.g. many records that match a few keys).
Feb 20, 2020 at 22:37 history edited Isaac L CC BY-SA 4.0
added 22 characters in body
Feb 5, 2020 at 22:25 review Low quality posts
Feb 5, 2020 at 23:34
Feb 5, 2020 at 21:59 history answered Isaac L CC BY-SA 4.0