Skip to content

Commit c7fdd27

Browse files
axe-fbfacebook-github-bot
authored andcommitted
Added more info to Module Registry systraces
Summary: Added module names to systraces for getConstants and getMethods. Also added systrace for moduleNames. We are starting to look at ways to optimize native modules, and having these traces helps Reviewed By: javache Differential Revision: D9012702 fbshipit-source-id: c79222f36988bef3a108ed91d1ea1318d3576b40
1 parent 1bc5226 commit c7fdd27

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ReactCommon/cxxreact/ModuleRegistry.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ void ModuleRegistry::updateModuleNamesFromIndex(size_t index) {
4141
}
4242

4343
void ModuleRegistry::registerModules(std::vector<std::unique_ptr<NativeModule>> modules) {
44+
SystraceSection s_("ModuleRegistry::registerModules");
4445
if (modules_.empty() && unknownModules_.empty()) {
4546
modules_ = std::move(modules);
4647
} else {
@@ -67,6 +68,7 @@ void ModuleRegistry::registerModules(std::vector<std::unique_ptr<NativeModule>>
6768
}
6869

6970
std::vector<std::string> ModuleRegistry::moduleNames() {
71+
SystraceSection s_("ModuleRegistry::moduleNames");
7072
std::vector<std::string> names;
7173
for (size_t i = 0; i < modules_.size(); i++) {
7274
std::string name = normalizeName(modules_[i]->getName());
@@ -106,12 +108,12 @@ folly::Optional<ModuleConfig> ModuleRegistry::getConfig(const std::string& name)
106108
folly::dynamic config = folly::dynamic::array(name);
107109

108110
{
109-
SystraceSection s_("getConstants");
111+
SystraceSection s_("ModuleRegistry::getConstants", "module", name);
110112
config.push_back(module->getConstants());
111113
}
112114

113115
{
114-
SystraceSection s_("getMethods");
116+
SystraceSection s_("ModuleRegistry::getMethods", "module", name);
115117
std::vector<MethodDescriptor> methods = module->getMethods();
116118

117119
folly::dynamic methodNames = folly::dynamic::array;

0 commit comments

Comments
 (0)