-
Notifications
You must be signed in to change notification settings - Fork 355
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
youki original config #447
Conversation
I am not sure I follow the argument. Can you elaborate on why the spec "is too much information and isn't good for performance"? |
@yihuaf |
That's an interesting observation. The concern would be if we have to add more things to the YoukiConfig later but I am in favor to try it out. It would also be interesting to benchmark the difference. To be honest, given the size of the spec file, which is likely to be less than 4K, I have a suspicion that the performance difference is small. |
@yihuaf I don't think it's a very big improvement about the performance, but the current form is one that I slacked off on in its initial form (I slacked off because I was so close to getting the sample working), so fixing that is a big part of it. |
If performance is not the concern, where is the harm in saving the whole spec? With this addition we would have to maintain two spec "things" but the gain is not really clear to me. I am open to trying it out, but for me there would have to be a measurable performance improvement to justify this. |
@yihuaf @Furisto $ $ hyperfine --prepare 'sudo sync; echo 3 | sudo tee /proc/sys/vm/drop_caches' --warmup 10 --min-runs 100 'sudo ./youki create -b tutorial a && sudo ./youki start a && sudo ./youki delete -f a' Results
|
Huh, proves again that you should always benchmark your performance improvements. I would not have expected such a big difference. Strange that the variance between runs is quite considerable. |
Good thing we didn't just assume. May be this is also a good time we start doing some benchmark and profiling to understand deeper. That max of 972+ms definitely calls to be investigated. I would benchmark next just the serialization/de-serialization, and read/write of config.json separately. If that proves our thesis, then let's try this change. We may also want to put a comment down that the change is for performance reason. When in the future this struct becomes closer to the size of spec, we should switch back. |
Codecov Report
@@ Coverage Diff @@
## main #447 +/- ##
==========================================
+ Coverage 60.44% 60.63% +0.18%
==========================================
Files 82 83 +1
Lines 12150 12180 +30
==========================================
+ Hits 7344 7385 +41
+ Misses 4806 4795 -11 |
Hey, this looks good 👍
Maybe add this in the doc-draft.md as well. Also, do you think that the config.rs should be renamed to youki_config.rs or something, to avoid misunderstanding it as general runtime config or so? |
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.
Looks good to me, apart from @YJDoc2 suggestion.
@YJDoc2 I commented on this area. I think the doc-draft is a bit much, but what do you think?
I renamed.
|
Why?
We have been using Spec as a way to pass container information to other commands(e.g. start command). However, this is too much information and isn't good for performance. Therefore we'll introduce youki original config to store only the information we need only.