Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Preemptive Iterator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
TROPHIME Valentin
Preemptive Iterator
Commits
afe00576
Commit
afe00576
authored
4 months ago
by
TROPHIME Valentin
Browse files
Options
Downloads
Patches
Plain Diff
update readme with alignment note and Criterion
parent
67fde48c
Branches
main
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
README.md
+7
-27
7 additions, 27 deletions
README.md
with
7 additions
and
27 deletions
README.md
+
7
−
27
View file @
afe00576
...
...
@@ -9,25 +9,8 @@ It provides the `PreemptiveIterator` trait implemented for all standard Rust
types implementing
`core::iter::Iterator`
. For the moment our trait provide only
`fold, for_each`
equivalent.
## Overhead measurement
There is an example in
`examples/overhead.rs`
you can try it with the following
command :
```
bash
cargo run
--release
--example
overhead
--
--reactivity-us
100
--n-iter
1000
--duration-us
10
```
The arguments are :
-
The number of iteration that you will perform.
-
Duration is the time it takes for each iteration to perform.
-
Reactivity is the targeted duration (in microseconds) between each
`yield_now().await`
inserted by our iterator.
Typical overhead values is between 0 and 2% at max for large number of
iteration. The bad overhead is about 30% and happens when using few iterations
(<50) with short duration tasks (< 10 μs).
Typical overhead values is between 1 and 5%. Worst case around 30% and happens
when using few iterations (<100) with short duration tasks (< 10 ns).
## TODO :
...
...
@@ -45,7 +28,11 @@ Reduce the Overhead for the worst cases, there are some ideas :
don't do any call to
`elapsed`
the overhead is still of approximately 10% on
the worst cases. This approach could help us to decrease this overhead.
-
Split at seems worst, why ?
-
Criterion helps reduce benchmarking weirdness but still need to run bench
with:
`RUSTFLAGS="-C llvm-args=-align-all-functions=6 -C llvm-args=-align-all-nofallthru-blocks=6" cargo bench`
To reduce impact of alignment.
-
With optimization for size ?
-
Try various block size policies:
-
Adapt grow rate for exponential grows up with information from measured
...
...
@@ -62,10 +49,3 @@ More functions in API:
-
`ge, gt, le, lt, eq, ne`
?
-
`min, max, min_by, max_by, min_by_key, max_by_key`
?
-
`product, sum, reduce`
?
Micro benchmark measurement weirdness:
-
Preemptive2 seems stable around 16% overhead in release and release-with-debug
-
Preemptive is unstable 3% in release and 45% in release-with-debug
-
TODO: keep only the Preemptive1 and try with/without debug, look and compare
asm maybe insert a call to a function with inline never to compare more easily
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