On Friday, 15 August 2014 at 14:40:36 UTC, Philippe Sigaud wrote:
Well, I created a wrapper around a std.array.uninitializedArray call, to manage the interface I need

Make sure you don't use that if your type has elaborate construction, or assumes a certain initial state (unless you are actually emplacing your objects of course).

I thought that, having lots of concatenation in my code, that'd be a bottleneck. But it appears than pre-allocation does not give me any speed-up.

If you are using "raw GC arrays", then the "raw" append operation will, outweigh the relocation cost on extension. So pre-allocation wouldn't really help in this situation (though the use of Appender *should*)
            • Re: ... Jonathan M Davis via Digitalmars-d-learn
            • Re: ... Dicebot via Digitalmars-d-learn
              • ... Philippe Sigaud via Digitalmars-d-learn
              • ... Dicebot via Digitalmars-d-learn
              • ... Philippe Sigaud via Digitalmars-d-learn
              • ... Messenger via Digitalmars-d-learn
              • ... Philippe Sigaud via Digitalmars-d-learn
              • ... monarch_dodra via Digitalmars-d-learn
              • ... monarch_dodra via Digitalmars-d-learn
              • ... Philippe Sigaud via Digitalmars-d-learn
              • ... monarch_dodra via Digitalmars-d-learn
              • ... Philippe Sigaud via Digitalmars-d-learn
              • ... monarch_dodra via Digitalmars-d-learn
              • ... Jonathan M Davis via Digitalmars-d-learn
              • ... monarch_dodra via Digitalmars-d-learn
        • Re: Appender ... Jonathan M Davis via Digitalmars-d-learn
      • Re: Appender is .... Dicebot via Digitalmars-d-learn
  • Re: Appender is ... slow Joseph Rushton Wakeling via Digitalmars-d-learn

Reply via email to