This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
Vibe-based AWS client | |
*/ | |
module vibe.aws.aws; | |
import std.algorithm; | |
import std.datetime; | |
import std.random; | |
import std.range; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/+ | |
dub --compiler=../ldc2/bin/ldmd2 --build=release -- 100 101 1000000000 1 true | |
19 secs, 185 ms, 593 μs, and 6 hnsecs | |
17 secs, 641 ms, 669 μs, and 1 hnsec | |
2.0296e+13 | |
2.0296e+13 | |
+/ | |
module benchmark_ndslice; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/+ | |
dub --compiler=../ldc2/bin/ldmd2 --build=release -- 100 101 1000000000 1 true | |
[19 secs, 699 ms, and 409 μs, 19 secs, 309 ms, 528 μs, and 3 hnsecs] | |
[2.0296e+13, 2.0296e+13] | |
+/ | |
module benchmark_ndslice; | |
import mir.ndslice; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//LDC 0.17 | |
//ldmd2 -c -O -inline -release -boundscheck=off -mcpu=native source/app.d -I../dip80-ndslice/source/ | |
//otool -vt app.o > app.ldc.s | |
app.o: | |
(__TEXT,__text) sectionca | |
__D3app11nd_test_valFS3std12experimental7ndslice5slice17__T5SliceVmi3TPdZ5SlicedZv: | |
0000000000000000 pushq %r14 | |
0000000000000002 pushq %rbx | |
0000000000000003 movq 0x18(%rsp), %r10 | |
0000000000000008 testq %r10, %r10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//dmd -c -O -inline -release -boundscheck=off source/app.d -I../dip80-ndslice/source/ | |
//obj2asm app.o > app.dmd.s | |
Mach-O Object File | |
FLAT group | |
public _D3app11nd_test_valFS3std12experimental7ndslice5slice17__T5SliceVmi3TPdZ5SlicedZv | |
public _D3app14nd_test_slice1FS3std12experimental7ndslice5slice17__T5SliceVmi3TPdZ5SliceS3std12experimental7ndslice5slice17__T5SliceVmi1TPdZ5SliceZv | |
public _D3app14nd_test_slice2FS3std12experimental7ndslice5slice17__T5SliceVmi3TPdZ5SliceS3std12experimental7ndslice5slice17__T5SliceVmi2TPdZ5SliceZv | |
public _D3app14nd_test_slice3FS3std12experimental7ndslice5slice17__T5SliceVmi3TPdZ5SliceS3std12experimental7ndslice5slice17__T5SliceVmi3TPdZ5SliceZv | |
public _D3app14nd_test_array1FS3std12experimental7ndslice5slice17__T5SliceVmi3TPdZ5SliceAdZv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import std.experimental.ndslice; | |
//3D += number | |
void nd_test_val(Slice!(3, double*) slice, double value) | |
{ | |
slice[] += value; | |
} | |
//3D += 1D | |
void nd_test_slice1(Slice!(3, double*) slice, Slice!(1, double*) value) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import std.datetime, std.stdio, std.uuid, std.traits; | |
void main() | |
{ | |
import std.datetime, std.stdio, std.conv; | |
string str = "24c24a92-5fc8-11e5-9d70-feff819cdc9f"; | |
ID id = ID("24c24a92-5fc8-11e5-9d70-feff819cdc9f"); | |
UUID uuid = UUID("24c24a92-5fc8-11e5-9d70-feff819cdc9f"); | |
size_t len; | |
auto b = benchmark!( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import std.stdio, std.datetime, std.uuid, std.conv; | |
struct NEW_UUID | |
{ | |
union | |
{ | |
ulong[2] ulongs; | |
static if(size_t.sizeof == 4) | |
uint[4] uints; | |
UUID id; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Matrix(T) | |
{ | |
this(size_t height, size_t width) | |
{ | |
ptr = (new T[height * width]).ptr; | |
this.height = height; | |
this.width = width; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foreach(d; 0..dl) | |
{ | |
auto pt = pdt[d]; | |
auto nw = ndw[d]; | |
auto qw = qdw[d]; | |
foreach(w; 0..wl) | |
qwd[w, d] = qw[w] = nw[w] / dotProduct(pt, pwt[w]); | |
} | |
foreach(t; 0..tl) |