Skip to content
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

GH-3413: Made the FS watcher start non-blocking. #5111

Closed
wants to merge 1 commit into from
Closed

Conversation

kittaakos
Copy link
Contributor

Closes #3413

Signed-off-by: Akos Kitta kittaakos@typefox.io

@kittaakos
Copy link
Contributor Author

I tried it locally, the FS change events from the watcher arrived as expected, the navigator worked as before. The application startup has improved a lot.

@kittaakos kittaakos force-pushed the GH-3413 branch 2 times, most recently from c2aa5b8 to 607795c Compare May 10, 2019 09:46
@akosyakov
Copy link
Member

I don't understand why it helps. Could you elaborate? I could not find a single client awaiting start.

});
}
}
toDisposeWatcher.push(Disposable.create(async () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is not the same as before. This code should not be executed if toDisposeWatcher.disposed is true

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for spotting it!

@@ -130,30 +129,39 @@ export class NsfwFileSystemWatcherServer implements FileSystemWatcherServer {
console.warn(`Failed to watch "${basePath}":`, error);
this.unwatchFileChanges(watcherId);
}
}).then((watcher: nsfw.NSFW | undefined) => {
if (!watcher) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how can it be undefined here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It cannot be, but based on the original code, we set the reference to undefined, so this is the only way to trick the compiler. By the way, see the original code, it was undefined there as well. I think this change is correct.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i see, it seems before tsc was smart enough to figure out that it cannot be undefined after calling nsfw

Closes #3413

Signed-off-by: Akos Kitta <kittaakos@typefox.io>
@kittaakos
Copy link
Contributor Author

I could not find a single client awaiting start.

I have experienced the performance drop in the electron-based application for a downstream project, but I could reproduce it with the Theia electron example too. Note, one does not have to bundle it, just start with yarn --cwd ./examples/electron/start.

@kittaakos
Copy link
Contributor Author

I could not find a single client awaiting start.

I could not reproduce it in the browser consistently, it should be an electron specific problem. Here is my CPU profile of the electron application. I have used NODE_ENV=production node --prof ../../dev-packages/cli/lib/theia.js start --plugins=local-dir:../../plugins to geneate it.

Statistical profiling result from ./examples/electron/isolate-0x103800000-v8.log, (375 ticks, 3 unaccounted, 0 excluded).

 [Shared libraries]:
   ticks  total  nonlib   name
      5    1.3%          /usr/lib/system/libsystem_pthread.dylib
      5    1.3%          /usr/lib/system/libsystem_kernel.dylib
      2    0.5%          /usr/lib/system/libsystem_platform.dylib
      1    0.3%          /usr/lib/libc++abi.dylib

 [JavaScript]:
   ticks  total  nonlib   name
      3    0.8%    0.8%  LazyCompile: ~resolve path.js:1068:28
      3    0.8%    0.8%  LazyCompile: ~Script vm.js:44:14
      3    0.8%    0.8%  LazyCompile: ~Module._findPath internal/modules/cjs/loader.js:221:28
      3    0.8%    0.8%  Builtin: Call_ReceiverIsAny
      2    0.5%    0.6%  LazyCompile: ~Module.load internal/modules/cjs/loader.js:591:33
      2    0.5%    0.6%  LazyCompile: *normalizeString path.js:52:25
      2    0.5%    0.6%  Builtin: CallFunction_ReceiverIsAny
      1    0.3%    0.3%  LazyCompile: ~toString buffer.js:643:46
      1    0.3%    0.3%  LazyCompile: ~stat internal/modules/cjs/loader.js:84:14
      1    0.3%    0.3%  LazyCompile: ~splitCommand.forEach /Users/akos.kitta/git/theia/node_modules/yargs/lib/command.js:140:26
      1    0.3%    0.3%  LazyCompile: ~realpathSync fs.js:1375:22
      1    0.3%    0.3%  LazyCompile: ~isUint32 internal/validators.js:13:18
      1    0.3%    0.3%  LazyCompile: ~getOptions internal/fs/utils.js:167:20
      1    0.3%    0.3%  LazyCompile: ~dirname path.js:1259:28
      1    0.3%    0.3%  LazyCompile: ~createScript vm.js:273:22
      1    0.3%    0.3%  LazyCompile: ~closeSync fs.js:398:19
      1    0.3%    0.3%  LazyCompile: ~aw native array.js:488:12
      1    0.3%    0.3%  LazyCompile: ~allocate buffer.js:318:18
      1    0.3%    0.3%  LazyCompile: ~NativeModule.compile internal/bootstrap/loaders.js:303:44
      1    0.3%    0.3%  LazyCompile: ~Module.require internal/modules/cjs/loader.js:631:36
      1    0.3%    0.3%  LazyCompile: ~Module._resolveFilename internal/modules/cjs/loader.js:548:35
      1    0.3%    0.3%  LazyCompile: ~<anonymous> /Users/akos.kitta/git/theia/node_modules/yargs/node_modules/yargs-parser/index.js:638:47
      1    0.3%    0.3%  LazyCompile: *dirname path.js:1259:28
      1    0.3%    0.3%  Builtin: StringAdd_CheckNone_NotTenured
      1    0.3%    0.3%  Builtin: ObjectDefineProperty
      1    0.3%    0.3%  Builtin: LoadIC_Noninlined
      1    0.3%    0.3%  Builtin: KeyedStoreIC_Megamorphic
      1    0.3%    0.3%  Builtin: KeyedLoadIC_PolymorphicName
      1    0.3%    0.3%  Builtin: KeyedLoadIC
      1    0.3%    0.3%  Builtin: InterpreterEntryTrampoline
      1    0.3%    0.3%  Builtin: ArrayMap

 [C++]:
   ticks  total  nonlib   name
     93   24.8%   25.7%  t node::fs::Read(v8::FunctionCallbackInfo<v8::Value> const&)
     62   16.5%   17.1%  T node::contextify::ContextifyScript::New(v8::FunctionCallbackInfo<v8::Value> const&)
     51   13.6%   14.1%  t node::fs::InternalModuleReadJSON(v8::FunctionCallbackInfo<v8::Value> const&)
     15    4.0%    4.1%  T _getattrlistbulk
      6    1.6%    1.7%  t void node::Buffer::(anonymous namespace)::StringSlice<(node::encoding)1>(v8::FunctionCallbackInfo<v8::Value> const&)
      6    1.6%    1.7%  T node::fs::Close(v8::FunctionCallbackInfo<v8::Value> const&)
      5    1.3%    1.4%  t node::GetBinding(v8::FunctionCallbackInfo<v8::Value> const&)
      3    0.8%    0.8%  t node::fs::Open(v8::FunctionCallbackInfo<v8::Value> const&)
      3    0.8%    0.8%  t node::fs::InternalModuleStat(v8::FunctionCallbackInfo<v8::Value> const&)
      2    0.5%    0.6%  t void v8::internal::String::WriteToFlat<unsigned char>(v8::internal::String*, unsigned char*, int, int)
      2    0.5%    0.6%  t node::fs::LStat(v8::FunctionCallbackInfo<v8::Value> const&)
      2    0.5%    0.6%  t __malloc_initialize
      2    0.5%    0.6%  T v8::internal::interpreter::BytecodeArrayWriter::EmitBytecode(v8::internal::interpreter::BytecodeNode const*)
      2    0.5%    0.6%  T v8::internal::Scanner::ScanIdentifierOrKeywordInner(v8::internal::Scanner::LiteralScope*)
      2    0.5%    0.6%  T v8::internal::Factory::NewFixedArrayWithFiller(v8::internal::Heap::RootListIndex, int, v8::internal::Object*, v8::internal::PretenureFlag)
      2    0.5%    0.6%  T v8::internal::Factory::InitializeMap(v8::internal::Map*, v8::internal::InstanceType, int, v8::internal::ElementsKind, int)
      2    0.5%    0.6%  T node::TTYWrap::New(v8::FunctionCallbackInfo<v8::Value> const&)
      1    0.3%    0.3%  t void v8::internal::String::WriteToFlat<unsigned short>(v8::internal::String*, unsigned short*, int, int)
      1    0.3%    0.3%  t void v8::internal::SlotSet::Insert<(v8::internal::AccessMode)0>(int)
      1    0.3%    0.3%  t v8::internal::compiler::Typer::Visitor::Reduce(v8::internal::compiler::Node*)
      1    0.3%    0.3%  t v8::internal::ParserBase<v8::internal::Parser>::ParsePropertyName(v8::internal::AstRawString const**, v8::internal::ParserBase<v8::internal::Parser>::PropertyKind*, bool*, bool*, bool*, bool*, bool*, bool*)
      1    0.3%    0.3%  t v8::internal::ParserBase<v8::internal::Parser>::ParseMemberExpressionContinuation(v8::internal::Expression*, bool*, bool*)
      1    0.3%    0.3%  t v8::internal::Handle<v8::internal::String> v8::internal::JsonParser<true>::SlowScanJsonString<v8::internal::SeqOneByteString, unsigned char>(v8::internal::Handle<v8::internal::String>, int, int)
      1    0.3%    0.3%  t v8::internal::(anonymous namespace)::StringTableNoAllocateKey::IsMatch(v8::internal::Object*)
      1    0.3%    0.3%  t v8::internal::(anonymous namespace)::FinalizeUnoptimizedCompilationJob(v8::internal::UnoptimizedCompilationJob*, v8::internal::Handle<v8::internal::SharedFunctionInfo>, v8::internal::Isolate*)
      1    0.3%    0.3%  t v8::internal::(anonymous namespace)::ElementsAccessorBase<v8::internal::(anonymous namespace)::FastSloppyArgumentsElementsAccessor, v8::internal::(anonymous namespace)::ElementsKindTraits<(v8::internal::ElementsKind)7> >::GetEntryForIndex(v8::internal::Isolate*, v8::internal::JSObject*, v8::internal::FixedArrayBase*, unsigned int)
      1    0.3%    0.3%  t v8::base::TemplateHashMapEntry<unsigned long, unsigned int>* v8::base::TemplateHashMapImpl<unsigned long, unsigned int, v8::base::KeyEqualityMatcher<long>, v8::base::DefaultAllocationPolicy>::LookupOrInsert<v8::base::TemplateHashMapImpl<unsigned long, unsigned int, v8::base::KeyEqualityMatcher<long>, v8::base::DefaultAllocationPolicy>::LookupOrInsert(unsigned long const&, unsigned int, v8::base::DefaultAllocationPolicy)::'lambda'()>(unsigned long const&, unsigned int, v8::base::TemplateHashMapImpl<unsigned long, unsigned int, v8::base::KeyEqualityMatcher<long>, v8::base::DefaultAllocationPolicy>::LookupOrInsert(unsigned long const&, unsigned int, v8::base::DefaultAllocationPolicy)::'lambda'() const&, v8::base::DefaultAllocationPolicy)
      1    0.3%    0.3%  t node::(anonymous namespace)::ProcessWrap::Spawn(v8::FunctionCallbackInfo<v8::Value> const&)
      1    0.3%    0.3%  t int v8::internal::BinarySearch<(v8::internal::SearchMode)0, v8::internal::TransitionArray>(v8::internal::TransitionArray*, v8::internal::Name*, int, int*)
      1    0.3%    0.3%  t _tiny_free_no_lock
      1    0.3%    0.3%  t _small_malloc_should_clear
      1    0.3%    0.3%  T void v8::internal::LookupIterator::Start<true>()
      1    0.3%    0.3%  T v8::internal::interpreter::BytecodeRegisterOptimizer::RegisterTransfer(v8::internal::interpreter::BytecodeRegisterOptimizer::RegisterInfo*, v8::internal::interpreter::BytecodeRegisterOptimizer::RegisterInfo*)
      1    0.3%    0.3%  T v8::internal::interpreter::BytecodeRegisterOptimizer::CreateMaterializedEquivalent(v8::internal::interpreter::BytecodeRegisterOptimizer::RegisterInfo*)
      1    0.3%    0.3%  T v8::internal::interpreter::BytecodeGenerator::VisitLogicalOrExpression(v8::internal::BinaryOperation*)
      1    0.3%    0.3%  T v8::internal::interpreter::BytecodeGenerator::VisitCountOperation(v8::internal::CountOperation*)
      1    0.3%    0.3%  T v8::internal::interpreter::BytecodeArrayWriter::Write(v8::internal::interpreter::BytecodeNode*)
      1    0.3%    0.3%  T v8::internal::compiler::SimplifiedOperatorBuilder::SpeculativeSafeIntegerAdd(v8::internal::compiler::NumberOperationHint)
      1    0.3%    0.3%  T v8::internal::compiler::CommonOperatorReducer::ReduceMerge(v8::internal::compiler::Node*)
      1    0.3%    0.3%  T v8::internal::compiler::BytecodeLivenessMap::InitializeLiveness(int, int, v8::internal::Zone*)
      1    0.3%    0.3%  T v8::internal::compiler::AccessInfoFactory::ComputePropertyAccessInfo(v8::internal::Handle<v8::internal::Map>, v8::internal::Handle<v8::internal::Name>, v8::internal::compiler::AccessMode, v8::internal::compiler::PropertyAccessInfo*)
      1    0.3%    0.3%  T v8::internal::Zone::New(unsigned long)
      1    0.3%    0.3%  T v8::internal::TransitionsAccessor::Insert(v8::internal::Handle<v8::internal::Name>, v8::internal::Handle<v8::internal::Map>, v8::internal::SimpleTransitionFlag)
      1    0.3%    0.3%  T v8::internal::TransitionArray::Search(v8::internal::PropertyKind, v8::internal::Name*, v8::internal::PropertyAttributes, int*)
      1    0.3%    0.3%  T v8::internal::StringTable::LookupKey(v8::internal::Isolate*, v8::internal::StringTableKey*)
      1    0.3%    0.3%  T v8::internal::String::SlowFlatten(v8::internal::Handle<v8::internal::ConsString>, v8::internal::PretenureFlag)
      1    0.3%    0.3%  T v8::internal::String::SlowEquals(v8::internal::String*)
      1    0.3%    0.3%  T v8::internal::Scope::DeserializeScopeChain(v8::internal::Zone*, v8::internal::ScopeInfo*, v8::internal::DeclarationScope*, v8::internal::AstValueFactory*, v8::internal::Scope::DeserializationMode)
      1    0.3%    0.3%  T v8::internal::Scanner::Scan()
      1    0.3%    0.3%  T v8::internal::Runtime_PushBlockContext(int, v8::internal::Object**, v8::internal::Isolate*)
      1    0.3%    0.3%  T v8::internal::RegExpAtom::AppendToText(v8::internal::RegExpText*, v8::internal::Zone*)
      1    0.3%    0.3%  T v8::internal::Object::GetProperty(v8::internal::LookupIterator*)
      1    0.3%    0.3%  T v8::internal::Object::AddDataProperty(v8::internal::LookupIterator*, v8::internal::Handle<v8::internal::Object>, v8::internal::PropertyAttributes, v8::internal::ShouldThrow, v8::internal::Object::StoreFromKeyed)
      1    0.3%    0.3%  T v8::internal::Map::RawCopy(v8::internal::Handle<v8::internal::Map>, int, int)
      1    0.3%    0.3%  T v8::internal::Map::CopyWithField(v8::internal::Handle<v8::internal::Map>, v8::internal::Handle<v8::internal::Name>, v8::internal::Handle<v8::internal::FieldType>, v8::internal::PropertyAttributes, v8::internal::PropertyConstness, v8::internal::Representation, v8::internal::TransitionFlag)
      1    0.3%    0.3%  T v8::internal::Map::CopyAddDescriptor(v8::internal::Handle<v8::internal::Map>, v8::internal::Descriptor*, v8::internal::TransitionFlag)
      1    0.3%    0.3%  T v8::internal::JsonParser<true>::ParseJsonObject()
      1    0.3%    0.3%  T v8::internal::JSObject::IsExtensible(v8::internal::Handle<v8::internal::JSObject>)
      1    0.3%    0.3%  T v8::internal::Heap::UpdateTotalGCTime(double)
      1    0.3%    0.3%  T v8::internal::GlobalHandles::MarkNewSpaceWeakUnmodifiedObjectsPending(bool (*)(v8::internal::Heap*, v8::internal::Object**))
      1    0.3%    0.3%  T v8::internal::FeedbackVector::New(v8::internal::Isolate*, v8::internal::Handle<v8::internal::SharedFunctionInfo>)
      1    0.3%    0.3%  T v8::internal::Factory::NewJSArray(v8::internal::ElementsKind, v8::internal::PretenureFlag)
      1    0.3%    0.3%  T v8::internal::Factory::InitializeJSObjectFromMap(v8::internal::Handle<v8::internal::JSObject>, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Map>)
      1    0.3%    0.3%  T v8::internal::Factory::AllocateRawOneByteInternalizedString(int, unsigned int)
      1    0.3%    0.3%  T v8::internal::DeclarationScope::DeclarationScope(v8::internal::Zone*, v8::internal::AstValueFactory*)
      1    0.3%    0.3%  T v8::internal::BuiltinDeserializerAllocator::InitializeFromReservations(std::__1::vector<v8::internal::Heap::Chunk, std::__1::allocator<v8::internal::Heap::Chunk> > const&)
      1    0.3%    0.3%  T v8::internal::BaseNameDictionary<v8::internal::NameDictionary, v8::internal::NameDictionaryShape>::IterationIndices(v8::internal::Handle<v8::internal::NameDictionary>)
      1    0.3%    0.3%  T v8::internal::AstValueFactory::NewConsString(v8::internal::AstRawString const*)
      1    0.3%    0.3%  T _thread_get_state
      1    0.3%    0.3%  T _setiopolicy_np
      1    0.3%    0.3%  T _getipv4sourcefilter
      1    0.3%    0.3%  T __pthread_exit_if_canceled
      1    0.3%    0.3%  T __kernelrpc_mach_port_request_notification
      1    0.3%    0.3%  T ___pthread_init

 [Summary]:
   ticks  total  nonlib   name
     42   11.2%   11.6%  JavaScript
    317   84.5%   87.6%  C++
      9    2.4%    2.5%  GC
     13    3.5%          Shared libraries
      3    0.8%          Unaccounted

 [C++ entry points]:
   ticks    cpp   total   name
    234   77.0%   62.4%  T v8::internal::Builtin_HandleApiCall(int, v8::internal::Object**, v8::internal::Isolate*)
     29    9.5%    7.7%  T v8::internal::Runtime_CompileLazy(int, v8::internal::Object**, v8::internal::Isolate*)
     12    3.9%    3.2%  T v8::internal::Builtin_JsonParse(int, v8::internal::Object**, v8::internal::Isolate*)
      5    1.6%    1.3%  T v8::internal::Runtime_CompileOptimized_Concurrent(int, v8::internal::Object**, v8::internal::Isolate*)
      3    1.0%    0.8%  T v8::internal::Runtime_InterpreterDeserializeLazy(int, v8::internal::Object**, v8::internal::Isolate*)
      2    0.7%    0.5%  T v8::internal::Runtime_StoreIC_Miss(int, v8::internal::Object**, v8::internal::Isolate*)
      2    0.7%    0.5%  T v8::internal::Runtime_KeyedStoreIC_Miss(int, v8::internal::Object**, v8::internal::Isolate*)
      2    0.7%    0.5%  T v8::internal::Runtime_DeserializeLazy(int, v8::internal::Object**, v8::internal::Isolate*)
      2    0.7%    0.5%  T v8::internal::Runtime_CreateObjectLiteral(int, v8::internal::Object**, v8::internal::Isolate*)
      2    0.7%    0.5%  T v8::internal::Runtime_CreateListFromArrayLike(int, v8::internal::Object**, v8::internal::Isolate*)
      2    0.7%    0.5%  T v8::internal::Builtin_ObjectDefineProperty(int, v8::internal::Object**, v8::internal::Isolate*)
      1    0.3%    0.3%  t void v8::internal::String::WriteToFlat<unsigned char>(v8::internal::String*, unsigned char*, int, int)
      1    0.3%    0.3%  t v8::internal::(anonymous namespace)::StringTableNoAllocateKey::IsMatch(v8::internal::Object*)
      1    0.3%    0.3%  T v8::internal::Runtime_StringCharCodeAt(int, v8::internal::Object**, v8::internal::Isolate*)
      1    0.3%    0.3%  T v8::internal::Runtime_RegExpExec(int, v8::internal::Object**, v8::internal::Isolate*)
      1    0.3%    0.3%  T v8::internal::Runtime_PushBlockContext(int, v8::internal::Object**, v8::internal::Isolate*)
      1    0.3%    0.3%  T v8::internal::Runtime_NewObject(int, v8::internal::Object**, v8::internal::Isolate*)
      1    0.3%    0.3%  T v8::internal::Runtime_KeyedGetProperty(int, v8::internal::Object**, v8::internal::Isolate*)
      1    0.3%    0.3%  T v8::internal::Runtime_DefineDataPropertyInLiteral(int, v8::internal::Object**, v8::internal::Isolate*)
      1    0.3%    0.3%  T v8::internal::Runtime_CreateRegExpLiteral(int, v8::internal::Object**, v8::internal::Isolate*)

 [Bottom up (heavy) profile]:
  Note: percentage shows a share of a particular caller in the total
  amount of its parent calls.
  Callers occupying less than 1.0% are not shown.

   ticks parent  name
     93   24.8%  t node::fs::Read(v8::FunctionCallbackInfo<v8::Value> const&)
     93  100.0%    T v8::internal::Builtin_HandleApiCall(int, v8::internal::Object**, v8::internal::Isolate*)
     93  100.0%      LazyCompile: ~readSync fs.js:474:18
     93  100.0%        LazyCompile: ~tryReadSync fs.js:328:21
     93  100.0%          LazyCompile: ~readFileSync fs.js:340:22
     88   94.6%            LazyCompile: ~Module._extensions..js internal/modules/cjs/loader.js:710:37
      4    4.3%            LazyCompile: ~Module._extensions..json internal/modules/cjs/loader.js:717:39
      1    1.1%            LazyCompile: ~pkgUp /Users/akos.kitta/git/theia/node_modules/yargs/yargs.js:498:18

     62   16.5%  T node::contextify::ContextifyScript::New(v8::FunctionCallbackInfo<v8::Value> const&)
     62  100.0%    T v8::internal::Builtin_HandleApiCall(int, v8::internal::Object**, v8::internal::Isolate*)
     33   53.2%      LazyCompile: ~NativeModule.compile internal/bootstrap/loaders.js:303:44
     33  100.0%        LazyCompile: ~NativeModule.require internal/bootstrap/loaders.js:150:34
      4   12.1%          Script: ~<anonymous> stream.js:1:11
      4  100.0%            LazyCompile: ~NativeModule.compile internal/bootstrap/loaders.js:303:44
      3    9.1%          Script: ~<anonymous> tty.js:1:11
      3  100.0%            LazyCompile: ~NativeModule.compile internal/bootstrap/loaders.js:303:44
      3    9.1%          Script: ~<anonymous> crypto.js:1:11
      3  100.0%            LazyCompile: ~NativeModule.compile internal/bootstrap/loaders.js:303:44
      3    9.1%          LazyCompile: ~Module._load internal/modules/cjs/loader.js:503:24
      3  100.0%            LazyCompile: ~Module.require internal/modules/cjs/loader.js:631:36
      2    6.1%          Script: ~<anonymous> util.js:1:11
      2  100.0%            LazyCompile: ~NativeModule.compile internal/bootstrap/loaders.js:303:44
      2    6.1%          Script: ~<anonymous> fs.js:1:11
      2  100.0%            LazyCompile: ~NativeModule.compile internal/bootstrap/loaders.js:303:44
      2    6.1%          LazyCompile: ~startup internal/bootstrap/node.js:30:19
      2  100.0%            Script: ~bootstrapNodeJSCore internal/bootstrap/node.js:15:30
      1    3.0%          Script: ~<anonymous> tls.js:1:11
      1  100.0%            LazyCompile: ~NativeModule.compile internal/bootstrap/loaders.js:303:44
      1    3.0%          Script: ~<anonymous> internal/process/main_thread_only.js:1:11
      1  100.0%            LazyCompile: ~NativeModule.compile internal/bootstrap/loaders.js:303:44
      1    3.0%          Script: ~<anonymous> internal/modules/cjs/loader.js:1:11
      1  100.0%            LazyCompile: ~NativeModule.compile internal/bootstrap/loaders.js:303:44
      1    3.0%          Script: ~<anonymous> internal/fs/streams.js:1:11
      1  100.0%            LazyCompile: ~NativeModule.compile internal/bootstrap/loaders.js:303:44
      1    3.0%          Script: ~<anonymous> internal/child_process.js:1:11
      1  100.0%            LazyCompile: ~NativeModule.compile internal/bootstrap/loaders.js:303:44
      1    3.0%          Script: ~<anonymous> internal/async_hooks.js:1:11
      1  100.0%            LazyCompile: ~NativeModule.compile internal/bootstrap/loaders.js:303:44
      1    3.0%          Script: ~<anonymous> https.js:1:11
      1  100.0%            LazyCompile: ~NativeModule.compile internal/bootstrap/loaders.js:303:44
      1    3.0%          Script: ~<anonymous> http.js:1:11
      1  100.0%            LazyCompile: ~NativeModule.compile internal/bootstrap/loaders.js:303:44
      1    3.0%          Script: ~<anonymous> child_process.js:1:11
      1  100.0%            LazyCompile: ~NativeModule.compile internal/bootstrap/loaders.js:303:44
      1    3.0%          Script: ~<anonymous> assert.js:1:11
      1  100.0%            LazyCompile: ~NativeModule.compile internal/bootstrap/loaders.js:303:44
      1    3.0%          LazyCompile: ~setupProcessObject internal/bootstrap/node.js:331:30
      1  100.0%            LazyCompile: ~startup internal/bootstrap/node.js:30:19
      1    3.0%          LazyCompile: ~setupGlobalVariables internal/bootstrap/node.js:345:32
      1  100.0%            LazyCompile: ~startup internal/bootstrap/node.js:30:19
      1    3.0%          LazyCompile: ~setupGlobalTimeouts internal/bootstrap/node.js:394:31
      1  100.0%            LazyCompile: ~startup internal/bootstrap/node.js:30:19
      1    3.0%          LazyCompile: ~setupGlobalConsole internal/bootstrap/node.js:404:30
      1  100.0%            LazyCompile: ~startup internal/bootstrap/node.js:30:19
     29   46.8%      LazyCompile: ~Script vm.js:44:14
     29  100.0%        LazyCompile: ~createScript vm.js:273:22
     29  100.0%          LazyCompile: ~runInThisContext vm.js:322:26
     29  100.0%            LazyCompile: ~Module._compile internal/modules/cjs/loader.js:657:37

     51   13.6%  t node::fs::InternalModuleReadJSON(v8::FunctionCallbackInfo<v8::Value> const&)
     51  100.0%    T v8::internal::Builtin_HandleApiCall(int, v8::internal::Object**, v8::internal::Isolate*)
     51  100.0%      LazyCompile: ~readPackage internal/modules/cjs/loader.js:153:21
     51  100.0%        LazyCompile: ~tryPackage internal/modules/cjs/loader.js:174:20
     51  100.0%          LazyCompile: ~Module._findPath internal/modules/cjs/loader.js:221:28
     51  100.0%            LazyCompile: ~Module._resolveFilename internal/modules/cjs/loader.js:548:35

     15    4.0%  T _getattrlistbulk
      4   26.7%    T v8::internal::Runtime_CompileLazy(int, v8::internal::Object**, v8::internal::Isolate*)
      1   25.0%      Script: ~<anonymous> /Users/akos.kitta/git/theia/dev-packages/application-manager/lib/generator/abstract-generator.js:1:11
      1  100.0%        LazyCompile: ~Module._compile internal/modules/cjs/loader.js:657:37
      1  100.0%          LazyCompile: ~Module._extensions..js internal/modules/cjs/loader.js:710:37
      1  100.0%            LazyCompile: ~Module.load internal/modules/cjs/loader.js:591:33
      1   25.0%      LazyCompile: ~version /Users/akos.kitta/git/theia/node_modules/yargs/yargs.js:765:35
      1  100.0%        LazyCompile: ~Yargs /Users/akos.kitta/git/theia/node_modules/yargs/yargs.js:17:16
      1  100.0%          LazyCompile: ~Argv /Users/akos.kitta/git/theia/node_modules/yargs/index.js:11:15
      1  100.0%            Script: ~<anonymous> /Users/akos.kitta/git/theia/node_modules/yargs/index.js:1:11
      1   25.0%      LazyCompile: ~<anonymous> /Users/akos.kitta/git/theia/node_modules/tough-cookie/lib/cookie.js:1412:29
      1  100.0%        Builtin: ArrayForEach
      1  100.0%          Script: ~<anonymous> /Users/akos.kitta/git/theia/node_modules/tough-cookie/lib/cookie.js:1:11
      1  100.0%            LazyCompile: ~Module._compile internal/modules/cjs/loader.js:657:37
      1   25.0%      LazyCompile: ~<anonymous> /Users/akos.kitta/git/theia/dev-packages/cli/lib/theia.js:99:47
      1  100.0%        LazyCompile: ~step /Users/akos.kitta/git/theia/dev-packages/cli/lib/theia.js:29:18
      1  100.0%          LazyCompile: ~<anonymous> /Users/akos.kitta/git/theia/dev-packages/cli/lib/theia.js:28:40
      1  100.0%            LazyCompile: ~fulfilled /Users/akos.kitta/git/theia/dev-packages/cli/lib/theia.js:19:27
      1    6.7%    T v8::internal::Runtime_NewObject(int, v8::internal::Object**, v8::internal::Isolate*)
      1  100.0%      LazyCompile: ~LruCache /Users/akos.kitta/git/theia/node_modules/aws4/lru.js:5:18
      1  100.0%        LazyCompile: ~module.exports /Users/akos.kitta/git/theia/node_modules/aws4/lru.js:1:88
      1  100.0%          Script: ~<anonymous> /Users/akos.kitta/git/theia/node_modules/aws4/aws4.js:1:11
      1  100.0%            LazyCompile: ~Module._compile internal/modules/cjs/loader.js:657:37

      6    1.6%  t void node::Buffer::(anonymous namespace)::StringSlice<(node::encoding)1>(v8::FunctionCallbackInfo<v8::Value> const&)
      6  100.0%    T v8::internal::Builtin_HandleApiCall(int, v8::internal::Object**, v8::internal::Isolate*)
      6  100.0%      LazyCompile: ~stringSlice buffer.js:589:21
      6  100.0%        LazyCompile: ~toString buffer.js:643:46
      6  100.0%          LazyCompile: ~readFileSync fs.js:340:22
      5   83.3%            LazyCompile: ~Module._extensions..js internal/modules/cjs/loader.js:710:37
      1   16.7%            LazyCompile: ~Module._extensions..json internal/modules/cjs/loader.js:717:39

      6    1.6%  T node::fs::Close(v8::FunctionCallbackInfo<v8::Value> const&)
      6  100.0%    T v8::internal::Builtin_HandleApiCall(int, v8::internal::Object**, v8::internal::Isolate*)
      6  100.0%      LazyCompile: ~closeSync fs.js:398:19
      5   83.3%        LazyCompile: ~<anonymous> /Users/akos.kitta/git/theia/node_modules/graceful-fs/graceful-fs.js:48:59
      5  100.0%          LazyCompile: ~readFileSync fs.js:340:22
      5  100.0%            LazyCompile: ~Module._extensions..js internal/modules/cjs/loader.js:710:37
      1   16.7%        LazyCompile: ~readFileSync fs.js:340:22
      1  100.0%          LazyCompile: ~Module._extensions..js internal/modules/cjs/loader.js:710:37
      1  100.0%            LazyCompile: ~Module.load internal/modules/cjs/loader.js:591:33

      5    1.3%  t node::GetBinding(v8::FunctionCallbackInfo<v8::Value> const&)
      5  100.0%    T v8::internal::Builtin_HandleApiCall(int, v8::internal::Object**, v8::internal::Isolate*)
      4   80.0%      LazyCompile: ~binding internal/bootstrap/loaders.js:77:39
      2   50.0%        Script: ~<anonymous> crypto.js:1:11
      2  100.0%          LazyCompile: ~NativeModule.compile internal/bootstrap/loaders.js:303:44
      2  100.0%            LazyCompile: ~NativeModule.require internal/bootstrap/loaders.js:150:34
      1   25.0%        Script: ~<anonymous> internal/errors.js:1:11
      1  100.0%          LazyCompile: ~NativeModule.compile internal/bootstrap/loaders.js:303:44
      1  100.0%            LazyCompile: ~NativeModule.require internal/bootstrap/loaders.js:150:34
      1   25.0%        LazyCompile: ~startup internal/bootstrap/node.js:30:19
      1  100.0%          Script: ~bootstrapNodeJSCore internal/bootstrap/node.js:15:30
      1   20.0%      Script: ~bootstrapInternalLoaders internal/bootstrap/loaders.js:42:35

      5    1.3%  /usr/lib/system/libsystem_pthread.dylib
      2   40.0%    T v8::internal::Runtime_CompileLazy(int, v8::internal::Object**, v8::internal::Isolate*)
      1   50.0%      Script: ~<anonymous> /Users/akos.kitta/git/theia/node_modules/har-validator/node_modules/ajv/lib/compile/error_classes.js:1:11
      1  100.0%        LazyCompile: ~Module._compile internal/modules/cjs/loader.js:657:37
      1  100.0%          LazyCompile: ~Module._extensions..js internal/modules/cjs/loader.js:710:37
      1  100.0%            LazyCompile: ~Module.load internal/modules/cjs/loader.js:591:33
      1   50.0%      LazyCompile: ~module.exports.sync.opts /Users/akos.kitta/git/theia/node_modules/os-locale/index.js:83:27
      1  100.0%        LazyCompile: ~memoized /Users/akos.kitta/git/theia/node_modules/mem/index.js:20:28
      1  100.0%          LazyCompile: ~guessLocale /Users/akos.kitta/git/theia/node_modules/yargs/yargs.js:1150:24
      1  100.0%            LazyCompile: ~parseArgs /Users/akos.kitta/git/theia/node_modules/yargs/yargs.js:993:40
      1   20.0%    T v8::internal::Runtime_DeserializeLazy(int, v8::internal::Object**, v8::internal::Isolate*)
      1  100.0%      Script: ~<anonymous> internal/encoding.js:1:11
      1  100.0%        LazyCompile: ~NativeModule.compile internal/bootstrap/loaders.js:303:44
      1  100.0%          LazyCompile: ~NativeModule.require internal/bootstrap/loaders.js:150:34
      1  100.0%            Script: ~<anonymous> util.js:1:11

      5    1.3%  /usr/lib/system/libsystem_kernel.dylib
      3   60.0%    T v8::internal::Runtime_InterpreterDeserializeLazy(int, v8::internal::Object**, v8::internal::Isolate*)
      1   33.3%      Script: ~bootstrapInternalLoaders internal/bootstrap/loaders.js:42:35
      1   33.3%      Script: ~<anonymous> internal/util.js:1:11
      1  100.0%        LazyCompile: ~NativeModule.compile internal/bootstrap/loaders.js:303:44
      1  100.0%          LazyCompile: ~NativeModule.require internal/bootstrap/loaders.js:150:34
      1  100.0%            Script: ~<anonymous> internal/util/inspect.js:1:11
      1   33.3%      Script: ~<anonymous> :5:10
      1  100.0%        Script: ~<anonymous> :1:1
      1   20.0%    T v8::internal::Runtime_DeserializeLazy(int, v8::internal::Object**, v8::internal::Isolate*)
      1  100.0%      LazyCompile: ~step /Users/akos.kitta/git/theia/dev-packages/cli/lib/theia.js:21:22
      1  100.0%        LazyCompile: ~<anonymous> /Users/akos.kitta/git/theia/dev-packages/cli/lib/theia.js:18:46
      1  100.0%          Builtin: PromiseConstructor
      1  100.0%            LazyCompile: ~__awaiter /Users/akos.kitta/git/theia/dev-packages/cli/lib/theia.js:17:54

@kittaakos
Copy link
Contributor Author

A short update before I forget; this performance drop issue does not happen at all on my other mac. It also works perfectly with the browser example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

EditorNavigationContribution.onStart is slow
2 participants