Timeline for Should we avoid object creation in Java?
Current License: CC BY-SA 3.0
4 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| May 22, 2012 at 19:09 | comment | added | ratchet freak | @JarrodRoberson StringBuilder will at least double the current capacity or in other words the capacity will grow exponentially for only log(n) allocations | |
| May 22, 2012 at 18:11 | comment | added | user7519 | the biggest advantage in this StringBuilder approach is the pre-size the StringBuilder so that it never has to reallocate the underlying array with the StringBuilder(int) constructor. This makes it a single allocation, rather than a 1+N allocations. | |
| May 22, 2012 at 8:50 | history | edited | ratchet freak | CC BY-SA 3.0 | added 170 characters in body |
| May 22, 2012 at 8:43 | history | answered | ratchet freak | CC BY-SA 3.0 |