mirror of
https://github.com/enso-org/enso.git
synced 2024-12-23 10:42:05 +03:00
Log set_context
in profile data (#3362)
Any context loss is relevant to performance. Also, having the event in the log may help debugging any context-loss-related issues we might encounter.
This commit is contained in:
parent
85a5770b7f
commit
39f39fa687
@ -960,6 +960,7 @@ impl SceneData {
|
||||
}
|
||||
|
||||
pub fn set_context(&self, context: Option<&Context>) {
|
||||
let _profiler = profiler::start_objective!(profiler::APP_LIFETIME, "@set_context");
|
||||
self.symbols.set_context(context);
|
||||
*self.context.borrow_mut() = context.cloned();
|
||||
self.dirty.shape.set();
|
||||
|
@ -287,6 +287,8 @@ impl Measurement {
|
||||
pub enum Class {
|
||||
/// Profiler that is active during the execution of anything else, after early startup.
|
||||
OnFrame,
|
||||
/// Profiler that is run when a WebGL context is acquired or lost.
|
||||
SetContext,
|
||||
/// Any profiler that doesn't need special treatment.
|
||||
Normal,
|
||||
}
|
||||
@ -423,6 +425,7 @@ impl Label {
|
||||
fn classify(&self) -> Class {
|
||||
match self.name.as_str() {
|
||||
"@on_frame" => Class::OnFrame,
|
||||
"@set_context" => Class::SetContext,
|
||||
// Data producer is probably newer than consumer. Forward compatibility isn't necessary.
|
||||
name if name.starts_with('@') => panic!("Unrecognized special profiler: {:?}", name),
|
||||
_ => Class::Normal,
|
||||
|
Loading…
Reference in New Issue
Block a user