diff --git a/.gitattributes b/.gitattributes index 0b4d6cf632..271d733623 100644 --- a/.gitattributes +++ b/.gitattributes @@ -5145,6 +5145,7 @@ tests/bench/shootout/src/strcat.pp svneol=native#text/plain tests/bench/shootout/src/sumcol.pp svneol=native#text/plain tests/bench/shootout/src/takfp.pp svneol=native#text/plain tests/bench/shootout/src/wc.pp svneol=native#text/plain +tests/bench/shortbench.pp svneol=native#text/plain tests/bench/timer.pas svneol=native#text/plain tests/bench/whet.pas svneol=native#text/plain tests/dbdigest.cfg.example -text diff --git a/tests/bench/shortbench.pp b/tests/bench/shortbench.pp new file mode 100644 index 0000000000..54c7e164b6 --- /dev/null +++ b/tests/bench/shortbench.pp @@ -0,0 +1,159 @@ +program TestShortStr; +uses timer; + +const + TestSize=1000; {Use at least 10 for reasonable results} +type + BenType=array[1..8] of longint; +var + Total : longint; + headBen, + LoadBen, + ConcatBen, + DelBen, + InsBen, + CopyBen, + CmpBen, + MixBen : BenType; + +procedure TestSpeed(Row,Len:byte); +var + l : longint; + hstr, + OrgStr : shortstring; +begin + HeadBen[Row]:=Len; + OrgStr:=''; + while Length(OrgStr)