Skip to content

Commit 0894a43

Browse files
committed
fixup
1 parent 08b2bfb commit 0894a43

2 files changed

Lines changed: 11 additions & 6 deletions

File tree

bigint_benchmark/source/app.d

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,16 @@ void main()
5959
}
6060
else
6161
{
62+
import std.system: os;
6263
auto res = 10.benchmark!(testStd, testMir);
63-
dout << "std = " << res[0] << endl;
64-
dout << "mir = " << res[1] << endl;
65-
dout << "speedup = "
66-
<< (double(res[0].total!"usecs") / res[1].total!"usecs" - 1) * 100
67-
<< " %" << endl;
64+
auto ratio = double(res[0].total!"usecs") / res[1].total!"usecs";
65+
dout
66+
<< "--------------------------------------------" << endl
67+
<< "mir speedup = " << cast(int)((ratio - 1) * 100_0) / 10.0 << "%" << endl
68+
<< "std = " << res[0] << endl
69+
<< "mir = " << res[1] << endl
70+
<< " ............... " << size_t.sizeof * 8 << "bit " << os << " ............... " << endl
71+
<< "--------------------------------------------"
72+
<< endl;
6873
}
6974
}

source/mir/bignum/fixed.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ struct UInt(size_t size)
8888
///
8989
this(uint data)
9090
{
91-
data[0] = data;
91+
this.data[0] = data;
9292
}
9393

9494
///

0 commit comments

Comments
 (0)