Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TeeTimeVariants
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Christian Wulf
TeeTimeVariants
Commits
b40da93c
Commit
b40da93c
authored
10 years ago
by
Christian Wulf
Browse files
Options
Downloads
Patches
Plain Diff
worked on performance bug
parent
5b070da0
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/teetime/framework/concurrent/WorkerThread.java
+10
-3
10 additions, 3 deletions
src/main/java/teetime/framework/concurrent/WorkerThread.java
with
10 additions
and
3 deletions
src/main/java/teetime/framework/concurrent/WorkerThread.java
+
10
−
3
View file @
b40da93c
...
...
@@ -40,6 +40,8 @@ public class WorkerThread extends Thread {
private
final
StopWatch
stopWatch
=
new
StopWatch
();
private
final
StopWatch
iterationStopWatch
=
new
StopWatch
();
private
final
StopWatch
beforeStageExecutionStopWatch
=
new
StopWatch
();
private
final
StopWatch
afterStageExecutionStopWatch
=
new
StopWatch
();
private
final
StopWatch
stageExecutionStopWatch
=
new
StopWatch
();
private
final
List
<
Long
>
schedulingOverheadsInNs
=
new
LinkedList
<
Long
>();
private
long
durationInNs
;
...
...
@@ -71,18 +73,23 @@ public class WorkerThread extends Thread {
final
IStage
stage
=
this
.
stageScheduler
.
get
();
this
.
startStageExecution
(
stage
);
//
stageExecutionStopWatch.start(); // expensive: takes 1/3 of overall time
stageExecutionStopWatch
.
start
();
// expensive: takes 1/3 of overall time
final
boolean
executedSuccessfully
=
stage
.
execute
();
//
stageExecutionStopWatch.end();
stageExecutionStopWatch
.
end
();
this
.
finishStageExecution
(
stage
,
executedSuccessfully
);
afterStageExecutionStopWatch
.
start
();
if
(
this
.
shouldTerminate
)
{
this
.
executeTerminationPolicy
(
stage
,
executedSuccessfully
);
}
this
.
stageScheduler
.
determineNextStage
(
stage
,
executedSuccessfully
);
afterStageExecutionStopWatch
.
end
();
this
.
iterationStopWatch
.
end
();
final
long
schedulingOverhead
=
this
.
iterationStopWatch
.
getDurationInNs
()
-
stageExecutionStopWatch
.
getDurationInNs
();
// final long schedulingOverhead = this.iterationStopWatch.getDurationInNs() - stageExecutionStopWatch.getDurationInNs();
final
long
schedulingOverhead
=
afterStageExecutionStopWatch
.
getDurationInNs
();
schedulingOverheadInNs
+=
schedulingOverhead
;
if
((
iterations
%
10000
)
==
0
)
{
this
.
schedulingOverheadsInNs
.
add
(
schedulingOverheadInNs
);
...
...
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