Commit bfff991
committed
Page reuse optimization for Unifico (#28)
The main addition of this patch is a `recode` optimization for the case of unifico.
Basically, when we don't want to transform the pages, through the
`--no-transform` flag to `crit`, or the `NOTRANSFORM=1` flag to the
common makefile, we can reuse the source `pages-1.img` as the
destination page. This avoids copying the page, which saves time during
`crit recode`.
This is a nice and simple trick to actually show the benefit of avoiding
the transformation: Unifico only avoids the stack transformation, which
happens in `transform_stack_and_regs`, and by itself it cannot show much
speedup since the whole `recode` procedure is designed around the
assumption that there will be metadata and preprocessing needed to do
the transformation. So, lots of bookkeeping from `recode` is hard to
avoid even though we don't transform the stack. For this reason, a
simple optimization we do it to reuse the page, so we save on copying,
which in theory might not be possible for Popcorn (due to differences in
the various regions inside the page image, which are not guaranteed not
to cause issues if we blindly copy them, while in unifico we imposed as
much alignment as possible).
* Start simplifying recode in the case of no transformation
For now, it just moves the source pages to the destination to avoid
copying. This reuse saves some time already.
* Restore previous pages-1.img when benchmarking recode
This is helpful in our new recode approach where we reuse the src image,
but we need to back it up first and restore it, so that we can run this
measurement multiple times.
* Backup pages image before benchmarking recode
Through `hyperfine --setup`, before all the runs, we backup the pages
image and then before every run we restore it through `--prepare`. This
is because in the `NOTRANSFORM` optimization, we reuse the source page
as the destination page, so if we want to measure this multiple times,
we need to restore the original source page image.
* Add README for benchmarking1 parent 336392b commit bfff991
3 files changed
Lines changed: 45 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
567 | 567 | | |
568 | 568 | | |
569 | 569 | | |
570 | | - | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
571 | 574 | | |
572 | 575 | | |
573 | 576 | | |
| |||
676 | 679 | | |
677 | 680 | | |
678 | 681 | | |
679 | | - | |
680 | | - | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
681 | 688 | | |
682 | 689 | | |
683 | 690 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
160 | | - | |
| 160 | + | |
161 | 161 | | |
162 | 162 | | |
163 | | - | |
| 163 | + | |
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
| |||
0 commit comments