-
Couldn't load subscription status.
- Fork 293
CA-372059: refactor the type of host in squeeze.ml
#5387
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CA-372059: refactor the type of host in squeeze.ml
#5387
Conversation
b1c2e2b to
88acde0
Compare
use `Set` instead of `List` because `set_difference` implemented using `List` is quadratic cost Signed-off-by: Luca Zhang <feiya.zhang@cloud.com>
Signed-off-by: Luca Zhang <feiya.zhang@cloud.com>
d344e07 to
e7fcfd9
Compare
|
Could you please give me a pointer on how to read out the improvements from the flame graph? |
I ran the load testing by booting up 2048 VMs: #! /bin/bash
set -e
D=/boot/guest
mkdir -p $D
cd $D
wget https://github.com/lindig/xen-test-vm/releases/download/0.1.17/test-vm.xen.gz
UUID=$(xe vm-create name-label=minion)
xe vm-param-set PV-kernel=$D/test-vm.xen.gz uuid=$UUID
xe vm-memory-limits-set uuid=$UUID dynamic-max=16777216 dynamic-min=16777216 static-max=16777216 static-min=16777216
seq 1 2048 | xargs -P16 -n1 -I% xe vm-clone new-name-description=% new-name-label=% vm=minion
xe vm-list power-state=halted --minimal | tr , '\n' | xargs -P16 -n1 -I% sh -c "echo pausing % && xe vm-start paused=true uuid=%"then generate the flame graph in 10 minutes : I have sent files of raw flame graph svg to you by slack. Opening the flame graph in web browser could get more information. |
The file in github can be downloaded and inspected. I don't know why opening the link directly doesn't allow for inspection. |
For more inspection, I generated two differential flame graphs: In a differential flame graph, the red and blue areas represent the differences between two flame graphs. The color scheme is used to indicate the direction and relative magnitude of the change between the two datasets. Red: The red areas in the differential flame graph represent an increase or growth in the performance metric being visualized. The darker the red, the larger the increase in the metric for the specific frame in the stack. This indicates that the performance metric for those functions or code paths has increased in the second dataset compared to the first. Blue: Conversely, the blue areas in the differential flame graph represent a decrease or reduction in the performance metric. The darker the blue, the larger the decrease in the metric for the specific frame in the stack. This indicates that the performance metric for those functions or code paths has decreased in the second dataset compared to the first. The saturation of the colors is relative to the delta, so dark red or dark blue indicates a significant change, while very light frames can be ignored as they represent minimal changes. See more in https://www.brendangregg.com/blog/2014-10-31/cpi-flame-graphs.html. |
|
The high towers in the map are a result of not having tail-recursive maps. The stacks can be squashed by piping the perf data through scripts in FlameGraph like so: |
…ind a domain Signed-off-by: Luca Zhang <feiya.zhang@cloud.com>
e7fcfd9 to
8668f4e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some of this changes in the interface will need deletion from the module, as it's unused.
|
Could you squash the last 3 commits into one? |
4d3cd81 to
129220c
Compare
Yes, of course. Done. |
|
The changes themselves look generally good to me. |
All the tests in |
|
I was referring to whole-product tests using the internal framework ;) |
Signed-off-by: Luca Zhang <feiya.zhang@cloud.com>
129220c to
229d486
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good to me, the last commit passed the DMC e2e tests in job 194022
|
But anyway, the review and test have shown the correctness of the changes. Especially I believe these changes would result in much better performance when the |
pytype_reporter extracted 49 problem reports from pytype output.You can check the results of the job here |
There may be no In fact, we can't use The type of So we can't use Without redundant transformation, there is no alternative to use |

use
Setinstead ofListbecauseset_differenceimplemented usingListis quadratic costThe flame graph before refactoring:

The flame graph after refactoring:

Special thanks to @psafont and @edwintorok for guides.