Why Nostr? What is Njump?
2023-10-03 11:29:28

loopy pedestrian✍🏿 on Nostr: >replacing character with string in-place in std::string takes 400ms >appending to ...

>replacing character with string in-place in std::string takes 400ms
>appending to new std::ostringstream instead of replacing in-place takes 100ms
>same thing but with .append() calls to new string takes 15ms
i guess replacing in-place does some iterator invaidation and inserting and probably lots of memory gets copies there
the 100-15ms difference between streams and just a string is because of virtual calls, probably. didnt know it could make this much of a difference
Author Public Key
npub16c3wl5l4m7t88y0axaukhp0tx6dx76f7fc0flck380tmxh8gdcysle0e99