News for hackers. Stuff that matters.
Re:Ropes, an Alternative to Strings [pdf] (1995) by bonzini on Sunday November 01, 2020 @05:31AM (#24958532)
Appending to a string buffer that grows exponentially will copy roughly twice as many bytes as building the result in a buffer that has the exact size. If you have to copy out of the resizable buffer into an exact-size area of memory, that becomes three times.
Re:Ropes, an Alternative to Strings [pdf] (1995) by kd5bjo on Sunday November 01, 2020 @07:56AM (#24959140)
Also, once your buffer exceeds the virtual memory page size, those copies turn into page table updates that never touch the string data.