<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body smarttemplateinserted="true">
<div id="smartTemplate4-template">Hi,</div>
<div><br>
</div>
<div>
<blockquote type="cite">FillChar is on most platforms an assembly
function and FPC *never* inlines assembly functions. </blockquote>
<br>
</div>
<div>even without inlining, rep stosb is faster than FillChar:<br>
<p> {$asmmode intel}<br>
procedure repfillchar(var buffer; len: sizeuint; c: byte);<br>
begin<br>
asm<br>
mov al, c<br>
mov rdi, buffer<br>
mov rcx, len<br>
rep stosb<br>
end;<br>
end; <br>
</p>
<p><br>
</p>
</div>
<div>1GB:</div>
<div>fillchar: 364 ms<br>
repfillchar 321 ms<br>
<br>
4GB:<br>
fillchar: 1382 ms<br>
repfillchar:1217 ms</div>
<div><br>
</div>
<div>Bye,<br>
Benito </div>
<br>
</body>
</html>