Skip to content

Conversation

@stevedlawrence
Copy link
Member

Instead of allocation a single Future for every parse/unparse done during the CLI performance command, this instead allocate creates one Future per performance thread. All files to parse are added to a ConcurrentLinkedQueue and the consumer Future read from this queue until empty.

This also no longer stores the results of each parse/unparse run, instead just keeping tracking of the number of files processes and the average latency.

This changes avoid allocations during the performance command. In testing, this does not seem to affect the performance results in any meaningful way, but it does reduce allocations which makes profiling a bit cleaner.

DAFFODIL-3064

Instead of allocation a single Future for every parse/unparse done
during the CLI performance command, this instead allocate creates one
Future per performance thread. All files to parse are added to a
ConcurrentLinkedQueue and the consumer Future read from this queue until
empty.

This also no longer stores the results of each parse/unparse run,
instead just keeping tracking of the number of files processes and the
average latency.

This changes avoid allocations during the performance command. In
testing, this does not seem to affect the performance results in any
meaningful way, but it does reduce allocations which makes profiling a
bit cleaner.

DAFFODIL-3064
Copy link
Contributor

@olabusayoT olabusayoT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1. Minor labeling update

}
val totalTimeSec = totalTimeNS.toDouble / 1_000_000_000
val averageThroughput = (totalFiles.toDouble / totalTimeSec)
val averageLatency = (totalLatencyNS.toDouble / totalFiles / 1_000_000)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be clearer to label these averages with Sec/MS, NBD if not.

Also refactor to simiplify logic as much as possible, avoids the Either
and match/case and the Timer functions that can allocation lambdas. This
likely doesn't have any affect on performance, but in a critical loop it
makes sense to be as efficient as possible and this does not add much
complexity.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants