Closed Bug 1372776 Opened 8 years ago Closed 1 year ago

GCLI extremely slow at predications when no matches

Categories

(Core :: JavaScript Engine, defect, P3)

55 Branch
x86
Windows 10
defect

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: ananuti, Unassigned)

References

Details

Steps to reproduce: 1. Shift+F2 to open the Dev Toolbar. 2. Type "pref set " (space after set). 3. Press up arrow ↑ key. 4. Press tab ↹ key. 5. Press backspace ⌫ twice. 6. Type 123. It''ll slightly hang for 1 and delayed for 2 and 3. Hang Report #1 (11 seconds) js::LookupName(JSContext *,JS::Handle<js::PropertyName *>,JS::Handle<JSObject *>,JS::MutableHandle<JSObject *>,JS::MutableHandle<JSObject *>,JS::MutableHandle<JS::PropertyResult>) (in xul.pdb) js::jit::IonGetNameIC::update(JSContext *,JS::Handle<JSScript *>,js::jit::IonGetNameIC *,JS::Handle<JSObject *>,JS::MutableHandle<JS::Value>) (in xul.pdb) 0xffffffff 0xffffffff free_impl (in mozglue.pdb) 0xffffffff 0xffffffff 0xffffffff js::jit::DoCompareFallback (in xul.pdb) js::jit::IonCannon(JSContext *,js::RunState &) (in xul.pdb) js::jit::IonCannon(JSContext *,js::RunState &) (in xul.pdb) 0xffffffff Hang Report #2 (11 seconds) with_LookupProperty (in xul.pdb) js::LookupName(JSContext *,JS::Handle<js::PropertyName *>,JS::Handle<JSObject *>,JS::MutableHandle<JSObject *>,JS::MutableHandle<JSObject *>,JS::MutableHandle<JS::PropertyResult>) (in xul.pdb) js::jit::IonGetNameIC::update(JSContext *,JS::Handle<JSScript *>,js::jit::IonGetNameIC *,JS::Handle<JSObject *>,JS::MutableHandle<JS::Value>) (in xul.pdb) 0xffffffff 0xffffffff js::jit::AttachBaselineCacheIRStub(JSContext *,js::jit::CacheIRWriter const &,js::jit::CacheKind,js::jit::ICStubEngine,JSScript *,js::jit::ICFallbackStub *,bool *) (in xul.pdb) js::TypeMonitorCall(JSContext *,JS::CallArgs const &,bool) (in xul.pdb) Hang Report #3 (11 seconds) js::NativeObject::getReservedSlot(unsigned int) (in xul.pdb) with_LookupProperty (in xul.pdb) js::LookupName(JSContext *,JS::Handle<js::PropertyName *>,JS::Handle<JSObject *>,JS::MutableHandle<JSObject *>,JS::MutableHandle<JSObject *>,JS::MutableHandle<JS::PropertyResult>) (in xul.pdb) js::jit::IonGetNameIC::update(JSContext *,JS::Handle<JSScript *>,js::jit::IonGetNameIC *,JS::Handle<JSObject *>,JS::MutableHandle<JS::Value>) (in xul.pdb) 0xffffffff 0xffffffff js::jit::AttachBaselineCacheIRStub(JSContext *,js::jit::CacheIRWriter const &,js::jit::CacheKind,js::jit::ICStubEngine,JSScript *,js::jit::ICFallbackStub *,bool *) (in xul.pdb) JSScript::types() (in xul.pdb) js::RunScript(JSContext *,js::RunState &) (in xul.pdb) js::InternalCallOrConstruct(JSContext *,JS::CallArgs const &,js::MaybeConstruct) (in xul.pdb) InternalCall (in xul.pdb) js::jit::DoCallFallback (in xul.pdb) 0xffffffff 0xffffffff 0xffffffff js::jit::EnterBaselineMethod(JSContext *,js::RunState &) (in xul.pdb) Interpret (in xul.pdb) js::RunScript(JSContext *,js::RunState &) (in xul.pdb) js::InternalCallOrConstruct(JSContext *,JS::CallArgs const &,js::MaybeConstruct) (in xul.pdb) InternalCall (in xul.pdb) PromiseReactionJob (in xul.pdb) js::InternalCallOrConstruct(JSContext *,JS::CallArgs const &,js::MaybeConstruct) (in xul.pdb) js::Call(JSContext *,JS::Handle<JS::Value>,JS::Handle<JS::Value>,js::AnyInvokeArgs const &,JS::MutableHandle<JS::Value>) (in xul.pdb) JS::Call(JSContext *,JS::Handle<JS::Value>,JS::Handle<JS::Value>,JS::HandleValueArray const &,JS::MutableHandle<JS::Value>) (in xul.pdb) mozilla::PromiseJobRunnable::Run() (in xul.pdb) mozilla::dom::Promise::PerformMicroTaskCheckpoint() (in xul.pdb) XPCJSContext::AfterProcessTask(unsigned int) (in xul.pdb) nsThread::ProcessNextEvent(bool,bool *) (in xul.pdb) mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate *) (in xul.pdb) MessageLoop::RunHandler() (in xul.pdb) MessageLoop::Run() (in xul.pdb) nsBaseAppShell::Run() (in xul.pdb) nsAppShell::Run() (in xul.pdb) nsAppStartup::Run() (in xul.pdb) XREMain::XRE_mainRun() (in xul.pdb) XREMain::XRE_main(int,char * * const,mozilla::BootstrapConfig const &) (in xul.pdb) XRE_main(int,char * * const,mozilla::BootstrapConfig const &) (in xul.pdb) mozilla::BootstrapImpl::XRE_main(int,char * * const,mozilla::BootstrapConfig const &) (in xul.pdb) wmain (in firefox.pdb) __scrt_common_main_seh (in firefox.pdb) BaseThreadInitThunk (in kernel32.pdb) __RtlUserThreadStart (in ntdll.pdb) _RtlUserThreadStart (in ntdll.pdb) Shu, I'm ni you as you wrote this code in bug 1263355. :)
Flags: needinfo?(shu)
When the GCLI autocompletion falls back to fuzzy mode we get extremely poor perf due to the use of non-syntactic environment lookups. The code is running in a non-syntactic WithEnvironment which uses a very slow path to include CheckUnscopables. GCLI should probably make sure names are concrete before calling the fuzzy lookup. Right now the fuzzy lookup constantly does expensive callbacks as it runs. It should take a snapshot at the beginning of the spell call. Ion could do a better job, but GCLI should really be cleaned up in this case. Profile: https://perfht.ml/2xaQv7l
Flags: needinfo?(shu)
Priority: -- → P3
Summary: slightly hang @ js::LookupName → GCLI extremely slow at predications when no matches
Severity: normal → S3
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.