Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
misc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
misc
Commits
2edd61bd
Commit
2edd61bd
authored
Mar 22, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
5a25f4ae
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
321 additions
and
129 deletions
+321
-129
Makefile
Makefile
+4
-0
plotit.py
plotit.py
+6
-6
t_copy_c.c
t_copy_c.c
+7
-7
t_copy_c.csv
t_copy_c.csv
+149
-55
t_copy_go.csv
t_copy_go.csv
+148
-54
t_copy_go.go
t_copy_go.go
+7
-7
No files found.
Makefile
View file @
2edd61bd
...
...
@@ -9,6 +9,10 @@ $(XDAT) :
bench
:
bench_c bench_go
bench_copy
:
t_copy_c t_copy_go
./t_copy_c
>
t_copy_c.csv
./t_copy_go
>
t_copy_go.csv
bench_c
:
t_syspread_c $(XDAT) t_copy_c
./t_syspread_c
$(XDAT)
>
t_syspread_c.csv
./t_copy_c
>
t_copy_c.csv
...
...
plotit.py
View file @
2edd61bd
...
...
@@ -27,16 +27,16 @@ copy_go = loadxy("t_copy_go.csv")
plt
.
title
(
"Timing for syspread & memcopy"
)
plotxy
(
pread_c
,
label
=
"syspread/c"
)
plotxy
(
pread_go
,
label
=
"syspread/go"
)
#
plotxy(pread_c, label="syspread/c")
#
plotxy(pread_go, label="syspread/go")
plotxy
(
copy_c
,
label
=
"copy/c"
)
plotxy
(
copy_go
,
label
=
"copy/go"
)
assert
pread_c
[
0
]
==
copy_c
[
0
]
plotxy
((
pread_c
[
0
],
np
.
array
(
pread_c
[
1
])
-
np
.
array
(
copy_c
[
1
])),
label
=
"syspread/c - copy/c"
)
#
assert pread_c[0] == copy_c[0]
#
plotxy((pread_c[0], np.array(pread_c[1]) - np.array(copy_c[1])), label="syspread/c - copy/c")
plt
.
legend
()
plt
.
ylabel
(
'time (ns)'
)
plt
.
xlabel
(
'buffer size (bytes)'
)
#
plt.show()
plt
.
savefig
(
'syspread.png'
)
plt
.
show
()
#
plt.savefig('syspread.png')
t_copy_c.c
View file @
2edd61bd
...
...
@@ -22,9 +22,9 @@ double microtime() {
}
// 12345678
#define NITER 100000
0
#define NITER 100000
#define BUFSIZE
4096
#define BUFSIZE
64*1024
static
char
buf
[
BUFSIZE
];
static
char
buf2
[
BUFSIZE
];
...
...
@@ -48,12 +48,12 @@ int main() {
printf
(
"%ld
\t
%.1f
\n
"
,
size
,
(
Tend
-
Tstart
)
/
NITER
/
1E-9
);
if
(
size
<
1
6
)
{
size
+=
1
;
// detailed start
}
else
if
(
size
<
128
)
{
size
+=
1
6
;
if
(
size
<
1
024
)
{
size
+=
1
28
;
// detailed start
}
else
if
(
size
<
8
*
1024
)
{
size
+=
25
6
;
}
else
{
size
+=
128
;
size
+=
512
;
}
}
}
t_copy_c.csv
View file @
2edd61bd
0 2.8
1 2.4
2 2.7
3 2.7
4 3.0
5 2.9
6 3.0
7 3.0
8 2.4
9 2.5
10 2.5
11 2.5
12 2.6
13 2.6
14 2.5
15 2.5
16 2.4
32 2.5
48 2.5
64 2.1
80 4.3
96 2.7
112 3.5
128 4.6
256 3.5
384 5.3
512 6.8
640 7.6
768 8.7
896 10.0
1024 11.2
1152 12.1
1280 13.0
1408 14.2
1536 15.4
1664 16.7
1792 17.8
1920 18.9
2048 20.1
2176 22.4
2304 24.2
2432 25.8
2560 26.6
2688 27.6
2816 28.4
2944 29.6
3072 30.9
3200 32.1
3328 33.4
3456 34.4
3584 35.9
3712 36.6
3840 38.1
3968 38.9
4096 41.0
0 3.2
128 5.6
256 4.2
384 6.4
512 8.3
640 9.3
768 10.5
896 12.1
1024 13.6
1280 15.7
1536 18.6
1792 21.5
2048 24.4
2304 30.1
2560 32.4
2816 34.3
3072 32.7
3328 35.5
3584 37.8
3840 40.4
4096 43.4
4352 56.7
4608 58.7
4864 58.4
5120 61.1
5376 63.1
5632 65.2
5888 67.5
6144 69.9
6400 72.3
6656 75.0
6912 77.0
7168 79.3
7424 82.1
7680 84.1
7936 86.4
8192 88.8
8704 93.8
9216 98.2
9728 102.9
10240 107.7
10752 114.0
11264 117.1
11776 121.8
12288 126.5
12800 131.2
13312 135.9
13824 140.7
14336 145.9
14848 150.1
15360 154.8
15872 159.9
16384 164.6
16896 169.5
17408 173.7
17920 180.2
18432 191.6
18944 207.3
19456 208.8
19968 228.3
20480 231.0
20992 250.4
21504 273.9
22016 285.3
22528 283.4
23040 314.9
23552 326.2
24064 343.7
24576 366.6
25088 365.5
25600 349.5
26112 360.2
26624 369.0
27136 382.2
27648 391.7
28160 398.4
28672 404.0
29184 403.7
29696 417.0
30208 424.5
30720 433.0
31232 443.6
31744 454.6
32256 466.0
32768 470.1
33280 477.0
33792 502.5
34304 507.4
34816 512.7
35328 526.8
35840 531.2
36352 524.9
36864 538.7
37376 546.9
37888 558.5
38400 547.9
38912 560.2
39424 578.5
39936 585.7
40448 593.4
40960 597.1
41472 604.7
41984 598.6
42496 604.1
43008 622.3
43520 664.6
44032 661.4
44544 665.8
45056 666.3
45568 669.8
46080 678.6
46592 687.2
47104 691.2
47616 702.5
48128 711.8
48640 720.3
49152 723.1
49664 725.4
50176 733.2
50688 759.3
51200 771.2
51712 788.2
52224 811.3
52736 833.7
53248 819.3
53760 810.9
54272 818.0
54784 815.6
55296 825.8
55808 824.0
56320 831.1
56832 851.1
57344 863.8
57856 865.2
58368 865.8
58880 876.5
59392 887.2
59904 905.3
60416 920.3
60928 927.7
61440 925.2
61952 925.3
62464 954.2
62976 990.2
63488 1002.5
64000 1049.7
64512 1100.6
65024 1079.8
65536 1041.3
t_copy_go.csv
View file @
2edd61bd
0 2.0
1 3.8
2 3.1
3 3.2
4 2.4
5 3.5
6 3.5
7 3.5
8 2.4
9 3.5
10 3.5
11 3.5
12 3.5
13 3.5
14 3.4
15 3.4
16 2.9
32 3.0
48 4.5
64 4.0
80 6.6
96 6.6
112 7.1
128 6.9
256 10.4
384 10.8
0 2.6
128 5.7
256 8.7
384 10.5
512 12.2
640 13.2
768 14.5
896 15.7
1024 16.8
1152 18.3
1280 19.3
1408 20.5
1536 21.4
1664 22.8
1792 24.1
1920 25.1
2048 26.0
2176 27.5
2304 28.9
2432 29.6
2560 31.3
2688 32.7
2816 33.5
2944 34.6
3072 35.5
3200 37.0
3328 38.2
3456 39.2
3584 40.8
3712 41.8
3840 43.0
3968 44.0
4096 45.3
640 13.5
768 14.4
896 15.2
1024 16.3
1280 18.7
1536 20.6
1792 23.9
2048 25.4
2304 28.3
2560 30.8
2816 33.4
3072 35.2
3328 37.5
3584 39.5
3840 41.9
4096 44.6
4352 47.2
4608 49.4
4864 51.4
5120 54.1
5376 56.1
5632 58.8
5888 61.3
6144 63.3
6400 66.3
6656 68.2
6912 70.3
7168 73.6
7424 75.4
7680 78.4
7936 79.8
8192 82.5
8704 87.1
9216 91.8
9728 96.9
10240 101.7
10752 106.0
11264 112.3
11776 116.2
12288 121.1
12800 125.9
13312 130.3
13824 134.4
14336 141.7
14848 148.7
15360 149.0
15872 155.1
16384 172.2
16896 172.4
17408 179.1
17920 228.3
18432 329.6
18944 389.0
19456 417.7
19968 433.6
20480 449.5
20992 469.1
21504 477.9
22016 479.2
22528 516.0
23040 535.3
23552 530.1
24064 533.7
24576 532.2
25088 512.2
25600 513.4
26112 502.6
26624 550.6
27136 539.4
27648 561.1
28160 620.1
28672 550.4
29184 557.4
29696 554.1
30208 547.6
30720 588.3
31232 617.6
31744 607.4
32256 599.0
32768 648.5
33280 643.8
33792 617.3
34304 595.0
34816 666.0
35328 700.9
35840 656.9
36352 714.3
36864 699.3
37376 655.7
37888 704.7
38400 672.1
38912 658.8
39424 699.6
39936 753.4
40448 783.6
40960 754.5
41472 778.1
41984 749.7
42496 761.4
43008 772.0
43520 854.6
44032 830.6
44544 819.5
45056 860.8
45568 844.8
46080 816.9
46592 853.8
47104 883.0
47616 890.1
48128 849.4
48640 895.0
49152 913.8
49664 946.5
50176 898.4
50688 880.0
51200 888.6
51712 910.5
52224 954.9
52736 1005.7
53248 976.1
53760 985.0
54272 961.7
54784 977.5
55296 986.8
55808 1006.3
56320 1021.0
56832 1021.5
57344 1042.4
57856 1112.4
58368 1054.4
58880 990.8
59392 1078.0
59904 1139.9
60416 1123.0
60928 1072.5
61440 994.6
61952 1100.5
62464 1157.0
62976 1097.9
63488 1138.8
64000 1188.8
64512 1226.6
65024 1214.5
65536 1150.0
t_copy_go.go
View file @
2edd61bd
...
...
@@ -6,9 +6,9 @@ import (
)
// 12345678
const
Niter
=
100000
0
const
Niter
=
100000
const
BufSize
=
4096
const
BufSize
=
64
*
1024
var
buf
[
BufSize
]
byte
var
buf2
[
BufSize
]
byte
...
...
@@ -31,12 +31,12 @@ func main() {
fmt
.
Printf
(
"%v
\t
%.1f
\n
"
,
size
,
float64
(
Tend
.
Sub
(
Tstart
)
.
Nanoseconds
())
/
Niter
)
switch
{
case
size
<
1
6
:
size
+=
1
// detailed start
case
size
<
128
:
size
+=
1
6
case
size
<
1
024
:
size
+=
1
28
// detailed start
case
size
<
8
*
1024
:
size
+=
25
6
default
:
size
+=
128
size
+=
512
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment