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
229adcc6
Commit
229adcc6
authored
Mar 22, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
4c89a1db
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11123 additions
and
16375 deletions
+11123
-16375
Makefile
Makefile
+1
-1
t_copy_c.c
t_copy_c.c
+11
-11
t_copy_c.csv
t_copy_c.csv
+5546
-8172
t_copy_go.csv
t_copy_go.csv
+5553
-8179
t_copy_go.go
t_copy_go.go
+12
-12
No files found.
Makefile
View file @
229adcc6
...
...
@@ -10,8 +10,8 @@ $(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
./t_copy_c
>
t_copy_c.csv
bench_c
:
t_syspread_c $(XDAT) t_copy_c
./t_syspread_c
$(XDAT)
>
t_syspread_c.csv
...
...
t_copy_c.c
View file @
229adcc6
...
...
@@ -22,9 +22,9 @@ double microtime() {
}
// 12345678
#define NITER 1000000
#define NITER 1000000
0
#define BUFSIZE 1024*1024
#define BUFSIZE
4*
1024*1024
static
char
buf
[
BUFSIZE
];
static
char
buf2
[
BUFSIZE
];
...
...
@@ -53,14 +53,14 @@ int main() {
printf
(
"%ld
\t
%.1f
\n
"
,
size
,
(
Tend
-
Tstart
)
/
niter
/
1E-9
);
size
+=
128
;
//if (size < 4
*1024) {
// size += 128; // detailed start
//} else if (size < 32
*1024) {
// size += 256
;
//
} else {
// size += 512
;
//
}
if
(
size
<
256
)
{
size
+=
1
;
// detailed start
}
else
if
(
size
<
32
*
1024
)
{
size
+=
128
;
}
else
if
(
size
<
1024
*
1024
)
{
size
+=
512
;
}
else
{
size
+=
1024
;
}
}
}
t_copy_c.csv
View file @
229adcc6
This diff is collapsed.
Click to expand it.
t_copy_go.csv
View file @
229adcc6
This diff is collapsed.
Click to expand it.
t_copy_go.go
View file @
229adcc6
...
...
@@ -6,9 +6,9 @@ import (
)
// 12345678
const
Niter
=
1000000
const
Niter
=
1000000
0
const
BufSize
=
1024
*
1024
const
BufSize
=
4
*
1024
*
1024
var
buf
[
BufSize
]
byte
var
buf2
[
BufSize
]
byte
...
...
@@ -36,15 +36,15 @@ func main() {
fmt
.
Printf
(
"%v
\t
%.1f
\n
"
,
size
,
float64
(
Tend
.
Sub
(
Tstart
)
.
Nanoseconds
())
/
float64
(
niter
))
s
ize
+=
128
//switch {
//case size < 4
*1024:
// size += 128 // detailed start
//case size < 32
*1024:
// size += 256
//
default:
// size += 512
//
}
s
witch
{
case
size
<
256
:
size
+=
1
// detailed start
case
size
<
32
*
1024
:
size
+=
128
case
size
<
1024
*
1024
:
size
+=
512
default
:
size
+=
1024
}
}
}
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