> Erm...
> We are *in* a Buffer object, so by definition we have one.
> So returning a readonly-copy with zero-copy effort is easy.
> It basically delays the creation of the shared string as long as possible.

Not really, we are in /a/ buffer object, not the subsection of it that
should be returned. You have to create a new one to return a
subsection. read_buffer is about as fast as it gets, it does the
minimal amount of work.

> As long as one is doing string operations
> (adding/substracting/matching) Buffer objects are better.  Once done
> with that, the final "result" can/should be a shared string.

Nothing that adds data to the buffer returns a string in the current
buffer code.

The only thing that returns a string is if you call read() or
read_hstring() on it.

-- 
Per
  • IOBuffer vs. Buffe... Stephen R. van den Berg
    • Re: IOBuffer ... Stephen R. van den Berg
      • Re: IOBuf... Stephen R. van den Berg
        • Re: I... Per Hedbor () @ Pike (-) developers forum
      • Re: IOBuf... Stephen R. van den Berg
        • Re: I... Arne Goedeke
          • R... Stephen R. van den Berg
            • ... Per Hedbor () @ Pike (-) developers forum
              • ... Per Hedbor () @ Pike (-) developers forum
                • ... Per Hedbor () @ Pike (-) developers forum
                • ... Peter Bortas @ Pike developers forum
                • ... Per Hedbor () @ Pike (-) developers forum
                • ... Henrik Grubbström (Lysator) @ Pike (-) developers forum
                • ... Per Hedbor () @ Pike (-) developers forum
                • ... Per Hedbor () @ Pike (-) developers forum
      • Re: IOBuf... Per Hedbor () @ Pike (-) developers forum
    • IOBuffer vs. ... Per Hedbor () @ Pike (-) developers forum

Reply via email to