-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
perf: lazy bootstrap options - first pass #21164
Conversation
What's the impact on startup time? |
/bench startup_nop_trivial |
startup_nop_trivial
start: id: server: |
Not significant. We'll see big improvement once we get rid of the |
#[op2] | ||
#[string] | ||
pub fn op_bootstrap_user_agent(state: &mut OpState) -> String { | ||
state.borrow::<BootstrapOptions>().user_agent.clone() | ||
} |
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.
More for information than a request for a change:
Given that we have to clone strings to return them and that the ops are not fast, I think it would be reasonable if you want to return the entire BootstrapOptions as a #[serde] return since it's a one-off on first use. It might simplify the code overall and I don't think it'll have a measurable impact on boot time.
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.
Sure that's an option too. Let's do that afterwards maybe? I don't want to solidify this approach until we get to see some improvements after the removal of bootstrap call (proabably a few more PRs before that's possible)
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.
Sounds good... merge when you're ready!
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. Some minor comments/nits only.
I need to turn off the zero-decimal place rounding here on kijunsan.... |
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.
Cool, I agree with Matt's comment about naming.
/bench startup_nop_trivial |
startup_nop_trivial
start: id: server: |
Move most runtime options to be lazily loaded. Constant options will be covered in a different PR. Towards #21133
Move most runtime options to be lazily loaded. Constant options will be covered in a different PR. Towards denoland#21133
Move most runtime options to be lazily loaded. Constant options will be covered in a different PR.
Towards #21133