A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/protocolbuffers/protobuf/commit/d8964801b196a65cb9ab26f7c17872993c76b140 below:

Add weak attribute to GetClassData to speed up clang builds. · protocolbuffers/protobuf@d896480 · GitHub

File tree Expand file treeCollapse file tree 5 files changed

+100

-43

lines changed

Filter options

Expand file treeCollapse file tree 5 files changed

+100

-43

lines changed Original file line number Diff line number Diff line change

@@ -4178,7 +4178,15 @@ void MessageGenerator::GenerateClassData(io::Printer* p) {

4178 4178

$pbi$::ClassDataFull $classname$_class_data_ =

4179 4179

$classname$::InternalGenerateClassData_();

4180 4180 4181 -

const $pbi$::ClassData* $nonnull$ $classname$::GetClassData() const {

4181 +

//~ This function needs to be marked as weak to avoid significantly

4182 +

//~ slowing down compilation times. This breaks up LLVM's SCC

4183 +

//~ in the .pb.cc translation units. Large translation units see a

4184 +

//~ reduction of roughly 50% of walltime for optimized builds.

4185 +

//~ Without the weak attribute all the messages in the file, including

4186 +

//~ all the vtables and everything they use become part of the same

4187 +

//~ SCC.

4188 +

PROTOBUF_ATTRIBUTE_WEAK const $pbi$::ClassData* $nonnull$

4189 +

$classname$::GetClassData() const {

4182 4190

$pin_weak_descriptor$;

4183 4191

$pbi$::PrefetchToLocalCache(&$classname$_class_data_);

4184 4192

$pbi$::PrefetchToLocalCache($classname$_class_data_.tc_table);

@@ -4221,7 +4229,15 @@ void MessageGenerator::GenerateClassData(io::Printer* p) {

4221 4229

const $pbi$::ClassDataLite<$type_size$> $classname$_class_data_ =

4222 4230

$classname$::InternalGenerateClassData_();

4223 4231 4224 -

const $pbi$::ClassData* $nonnull$ $classname$::GetClassData() const {

4232 +

//~ This function needs to be marked as weak to avoid significantly

4233 +

//~ slowing down compilation times. This breaks up LLVM's SCC

4234 +

//~ in the .pb.cc translation units. Large translation units see a

4235 +

//~ reduction of roughly 50% of walltime for optimized builds.

4236 +

//~ Without the weak attribute all the messages in the file, including

4237 +

//~ all the vtables and everything they use become part of the same

4238 +

//~ SCC.

4239 +

PROTOBUF_ATTRIBUTE_WEAK const $pbi$::ClassData* $nonnull$

4240 +

$classname$::GetClassData() const {

4225 4241

return $classname$_class_data_.base();

4226 4242

}

4227 4243

)cc");

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4