#1 Low level and performance » Memory Manager Benchmark Tool » 2017-02-09 04:48:37

Yegor
Replies: 1

Hi guys,

I want to compare the performance of a few memory managers in a multithreaded environment but I do not want to write my own Benchmark Tool. Is there any existing one that I can use? I quickly searched the internet but found only the benchmark results and no tool.

Thanks,
Yegor

#2 Re: Low level and performance » Delphi doesn't like multi-core CPUs (or the contrary) » 2011-04-07 09:40:30

Hi folks,

ab wrote:

2. string types and dynamic arrays just use the same LOCKed asm instruction everywhere, i.e. for every access which may lead into a write to the string.

I want to express my vision on the problem with string types and dynamic arrays. I believe everybody understands that dynamic arrays and strings are NOT actually thread safe (see an example below that leads to AV) and you have to synchronize an access to variables of such types on your own. If so, Embarcadero has to just mention this in documentation (Strings and Dyn Arrays are not tread safe) and remove "LOCK" instruction from ref counters as AB made in his workaround.

Am I missing something?

Regards,
Yegor

var
  s: string;

procedure Writer1(p: Pointer); stdcall;
var
  i: Integer;
begin
  for i := 1 to 1000000 do
    s := IntToStr(i);
end;

procedure Writer2(p: Pointer); stdcall;
var
  i: Integer;
begin
  for i := 1 to 1000000 do
    s := s + IntToStr(i);
end;

begin
  BeginThread(@Writer1);
  BeginThread(@Writer2);
  ReadLn;
end.

Board footer

Powered by FluxBB