Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
queues
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
samarth5
queues
Commits
c79f07bf
Commit
c79f07bf
authored
7 years ago
by
samarth5
Browse files
Options
Downloads
Patches
Plain Diff
Fixing labels of plots
parent
9f3f356a
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitignore
+2
-0
2 additions, 0 deletions
.gitignore
BenchmarkingModule.cpp
+25
-20
25 additions, 20 deletions
BenchmarkingModule.cpp
plot.py
+10
-2
10 additions, 2 deletions
plot.py
with
37 additions
and
22 deletions
.gitignore
+
2
−
0
View file @
c79f07bf
*.o
*.csv
*.txt
*.png
BenchmarkingModule
\ No newline at end of file
This diff is collapsed.
Click to expand it.
BenchmarkingModule.cpp
+
25
−
20
View file @
c79f07bf
...
...
@@ -48,8 +48,9 @@ int main()
int
numberOfItemsToDequeueLarge
=
100
;
int
oneThread
=
1
;
bool
isOnlyEnqueueOperation
=
true
;
int
numberOfMeasurements
=
100
;
int
numberOfMeasurements
=
10
;
int
maxThreads
=
thread
::
hardware_concurrency
();
Benchmark
<
char
*>
benchmark
;
Operation
<
char
*>
enqueueOperation1
(
make_shared
<
LockQueue
<
char
*>>
(),
EnqueueNItems
,
numberOfItemsToEnqueueSmall
,
oneThread
);
...
...
@@ -74,61 +75,65 @@ int main()
Operation
<
char
*>
enqueueDequeueOperation11
(
make_shared
<
CharmQueue
>
(),
EnqueueNItems
,
numberOfItemsToEnqueueSmall
,
DequeueNItems
,
numberOfItemsToDequeueLarge
,
numberOfMicrosecondsToDequeueFor
);
Operation
<
char
*>
enqueueDequeueOperation4
(
make_shared
<
LockQueue
<
char
*>>
(),
EnqueueNItems
,
numberOfItemsToEnqueueLarge
,
DequeueNItems
,
numberOfItemsToDequeueLarge
,
numberOfMicrosecondsToDequeueFor
);
Operation
<
char
*>
enqueueDequeueOperation12
(
make_shared
<
CharmQueue
>
(),
EnqueueNItems
,
numberOfItemsToEnqueueLarge
,
DequeueNItems
,
numberOfItemsToDequeueLarge
,
numberOfMicrosecondsToDequeueFor
);
Operation
<
char
*>
enqueueDequeueOperation12
(
make_shared
<
LockQueue
<
char
*>
>
(),
EnqueueNItems
,
numberOfItemsToEnqueueLarge
,
DequeueNItems
,
numberOfItemsToDequeueLarge
,
numberOfMicrosecondsToDequeueFor
);
ofstream
file1
;
file1
.
open
(
"1.txt"
);
file1
<<
"##Enqueue: Small number of items and only one thread."
<<
endl
<<
"Index
\t
Mean
\t\t
Sd
"
<<
endl
file1
<<
"Ne per thread: "
<<
numberOfItemsToEnqueueSmall
<<
"
\t
Nt: "
<<
1
<<
endl
<<
"Index
\t
\t
Values
"
<<
endl
<<
"1
\t
"
<<
benchmark
.
GetBenchmarkMeasure
(
enqueueOperation1
,
isOnlyEnqueueOperation
,
numberOfMeasurements
)
<<
"2
\t
"
<<
benchmark
.
GetBenchmarkMeasure
(
enqueueOperation9
,
isOnlyEnqueueOperation
,
numberOfMeasurements
);
ofstream
file2
;
file2
.
open
(
"2.txt"
);
file2
<<
"##Enqueue: Large number of items and only one thread."
<<
endl
<<
"Index
\t
Mean
\t\t
Sd
"
<<
endl
file2
<<
"Ne per thread: "
<<
numberOfItemsToEnqueueLarge
<<
"
\t
Nt: "
<<
1
<<
endl
<<
"Index
\t
\t
Values
"
<<
endl
<<
"1
\t
"
<<
benchmark
.
GetBenchmarkMeasure
(
enqueueOperation2
,
isOnlyEnqueueOperation
,
numberOfMeasurements
)
<<
"2
\t
"
<<
benchmark
.
GetBenchmarkMeasure
(
enqueueOperation10
,
isOnlyEnqueueOperation
,
numberOfMeasurements
);
ofstream
file3
;
file3
.
open
(
"3.txt"
);
file3
<<
"##Enqueue: Small number of items and one thread per hardware t
hread
."
<<
endl
<<
"Index
\t
Mean
\t\t
Sd
"
<<
endl
file3
<<
"Ne per thread: "
<<
numberOfItemsToEnqueueSmall
<<
"
\t
Nt: "
<<
maxT
hread
s
<<
endl
<<
"Index
\t
\t
Values
"
<<
endl
<<
"1
\t
"
<<
benchmark
.
GetBenchmarkMeasure
(
enqueueOperation3
,
isOnlyEnqueueOperation
,
numberOfMeasurements
)
<<
"2
\t
"
<<
benchmark
.
GetBenchmarkMeasure
(
enqueueOperation11
,
isOnlyEnqueueOperation
,
numberOfMeasurements
);
ofstream
file4
;
file4
.
open
(
"4.txt"
);
file4
<<
"##Enqueue: Large number of items and one thread per hardw
are
t
hread
."
<<
endl
<<
"Index
\t
Mean
\t\t
Sd
"
<<
endl
file4
<<
"Ne per thread: "
<<
numberOfItemsToEnqueueL
ar
g
e
<<
"
\t
Nt: "
<<
maxT
hread
s
<<
endl
<<
"Index
\t
\t
Values
"
<<
endl
<<
"1
\t
"
<<
benchmark
.
GetBenchmarkMeasure
(
enqueueOperation4
,
isOnlyEnqueueOperation
,
numberOfMeasurements
)
<<
"2
\t
"
<<
benchmark
.
GetBenchmarkMeasure
(
enqueueOperation12
,
isOnlyEnqueueOperation
,
numberOfMeasurements
);
ofstream
file5
;
file5
.
open
(
"5.txt"
);
file5
<<
"##EnqueueDequeue: Small number of items to enqueue, small number of items to dequeue and one thread per hardware thread."
<<
endl
<<
"Index
\t
Mean
\t\t
Sd"
<<
endl
file5
<<
"Ne per thread: "
<<
numberOfItemsToEnqueueSmall
<<
"
\t
Nd: "
<<
numberOfItemsToDequeueSmall
<<
"
\t
Nt: "
<<
maxThreads
<<
"
\t
DequeueInterval: "
<<
numberOfMicrosecondsToDequeueFor
<<
endl
// file5<<"##EnqueueDequeue: Small number of items to enqueue, small number of items to dequeue and one thread per hardware thread."<<endl
<<
"Index
\t\t
Values"
<<
endl
<<
"1
\t
"
<<
benchmark
.
GetBenchmarkMeasure
(
enqueueDequeueOperation1
,
!
isOnlyEnqueueOperation
,
numberOfMeasurements
)
<<
"2
\t
"
<<
benchmark
.
GetBenchmarkMeasure
(
enqueueDequeueOperation9
,
!
isOnlyEnqueueOperation
,
numberOfMeasurements
);
ofstream
file6
;
file6
.
open
(
"6.txt"
);
file6
<<
"##EnqueueDequeue: Large number of items to enqueue, small number of items to dequeue and one thread per hardware thread."
<<
endl
<<
"Index
\t
Mean
\t\t
Sd"
<<
endl
file6
<<
"Ne per thread: "
<<
numberOfItemsToEnqueueLarge
<<
"
\t
Nd: "
<<
numberOfItemsToDequeueSmall
<<
"
\t
Nt: "
<<
maxThreads
<<
"
\t
DequeueInterval: "
<<
numberOfMicrosecondsToDequeueFor
<<
endl
// file6<<"##EnqueueDequeue: Large number of items to enqueue, small number of items to dequeue and one thread per hardware thread."<<endl
<<
"Index
\t\t
Values"
<<
endl
<<
"1
\t
"
<<
benchmark
.
GetBenchmarkMeasure
(
enqueueDequeueOperation2
,
!
isOnlyEnqueueOperation
,
numberOfMeasurements
)
<<
"2
\t
"
<<
benchmark
.
GetBenchmarkMeasure
(
enqueueDequeueOperation10
,
!
isOnlyEnqueueOperation
,
numberOfMeasurements
);
ofstream
file7
;
file7
.
open
(
"7.txt"
);
file7
<<
"##EnqueueDequeue: Large number of items to enqueue, large number of items to dequeue and one thread per hardware thread."
<<
endl
<<
"Index
\t
Mean
\t\t
Sd"
<<
endl
file7
<<
"Ne per thread: "
<<
numberOfItemsToEnqueueSmall
<<
"
\t
Nd: "
<<
numberOfItemsToDequeueLarge
<<
"
\t
Nt: "
<<
maxThreads
<<
"
\t
DequeueInterval: "
<<
numberOfMicrosecondsToDequeueFor
<<
endl
// file7<<"##EnqueueDequeue: Large number of items to enqueue, large number of items to dequeue and one thread per hardware thread."<<endl
<<
"Index
\t\t
Values"
<<
endl
<<
"1
\t
"
<<
benchmark
.
GetBenchmarkMeasure
(
enqueueDequeueOperation3
,
!
isOnlyEnqueueOperation
,
numberOfMeasurements
)
<<
"2
\t
"
<<
benchmark
.
GetBenchmarkMeasure
(
enqueueDequeueOperation11
,
!
isOnlyEnqueueOperation
,
numberOfMeasurements
);
ofstream
file8
;
file8
.
open
(
"8.txt"
);
file8
<<
"##EnqueueDequeue: Large number of items to enqueue, large number of items to dequeue and one thread per hardware thread."
<<
endl
<<
"Index
\t
Mean
\t\t
Sd"
<<
endl
// file8<<"##EnqueueDequeue: Large number of items to enqueue, large number of items to dequeue and one thread per hardware thread."<<endl
file8
<<
"Ne per thread: "
<<
numberOfItemsToEnqueueLarge
<<
"
\t
Nd: "
<<
numberOfItemsToDequeueLarge
<<
"
\t
Nt: "
<<
maxThreads
<<
"
\t
DequeueInterval: "
<<
numberOfMicrosecondsToDequeueFor
<<
endl
<<
"Index
\t\t
Values"
<<
endl
<<
"1
\t
"
<<
benchmark
.
GetBenchmarkMeasure
(
enqueueDequeueOperation4
,
!
isOnlyEnqueueOperation
,
numberOfMeasurements
)
<<
"2
\t
"
<<
benchmark
.
GetBenchmarkMeasure
(
enqueueDequeueOperation12
,
!
isOnlyEnqueueOperation
,
numberOfMeasurements
);
...
...
@@ -186,5 +191,5 @@ int main()
// cout<<benchmark3.GetBenchmarkMeasure(enqueueDequeueOperation14, false, 5);
// cout<<benchmark3.GetBenchmarkMeasure(enqueueDequeueOperation15, false, 5);
// cout<<benchmark3.GetBenchmarkMeasure(enqueueDequeueOperation16, false, 5);
// cout<<endl;
// cout<<endl;
}
This diff is collapsed.
Click to expand it.
plot.py
+
10
−
2
View file @
c79f07bf
...
...
@@ -7,24 +7,32 @@ f, ax = plt.subplots(4, 2)
ir
=
0
jr
=
0
titles
=
[]
fileValues
=
[]
for
i
in
range
(
1
,
9
):
with
open
(
str
(
i
)
+
"
.txt
"
)
as
fileHandle
:
valuesToPlot
=
[]
lines
=
fileHandle
.
readlines
()[
2
:]
for
line
in
lines
:
lines
=
fileHandle
.
readlines
()
titles
.
append
(
lines
[
0
])
for
line
in
lines
[
2
:]:
details
=
line
.
split
(
"
\t
"
)
index
=
int
(
details
[
0
])
valuesToPlot
.
append
(
map
(
float
,
details
[
1
].
split
(
"
,
"
)))
fileValues
.
append
(
valuesToPlot
)
r
=
0
title_font
=
{
'
fontname
'
:
'
Arial
'
,
'
size
'
:
'
8
'
,
'
color
'
:
'
black
'
,
'
weight
'
:
'
normal
'
,
'
verticalalignment
'
:
'
center
'
}
for
fileValue
in
fileValues
:
ax
[
ir
,
jr
].
boxplot
(
fileValue
)
ax
[
ir
,
jr
].
set_title
(
titles
[
r
].
expandtabs
(),
title_font
)
r
+=
1
ax
[
ir
,
jr
].
set_xticklabels
(
tickLabels
)
jr
+=
1
if
jr
>=
2
:
ir
+=
1
jr
=
0
plt
.
subplots_adjust
(
left
=
None
,
bottom
=
None
,
right
=
None
,
top
=
None
,
wspace
=
0.2
,
hspace
=
0.4
)
plt
.
show
()
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment