You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/10/21 06:19:14 UTC
[GitHub] [pulsar-client-cpp] BewareMyPower opened a new issue, #60: Improvements on building the project
BewareMyPower opened a new issue, #60:
URL: https://github.com/apache/pulsar-client-cpp/issues/60
Currently the build time is long and the binary size is large. For example, building the C++ client with the default CMake options in my laptop with 8 threads is:
```bash
$ cmake -B build
$ time cmake --build build -j8
real 4m36.426s
user 31m50.682s
sys 1m24.831s
$ ls -lhS build/lib/CMakeFiles/PULSAR_OBJECT_LIB.dir/*.o | head -n 10
-rw-r--r-- 1 xyz xyz 25M Oct 21 14:09 build/lib/CMakeFiles/PULSAR_OBJECT_LIB.dir/ClientConnection.cc.o
-rw-r--r-- 1 xyz xyz 19M Oct 21 14:08 build/lib/CMakeFiles/PULSAR_OBJECT_LIB.dir/ClientImpl.cc.o
-rw-r--r-- 1 xyz xyz 13M Oct 21 14:08 build/lib/CMakeFiles/PULSAR_OBJECT_LIB.dir/ConsumerImpl.cc.o
-rw-r--r-- 1 xyz xyz 12M Oct 21 14:09 build/lib/CMakeFiles/PULSAR_OBJECT_LIB.dir/PatternMultiTopicsConsumerImpl.cc.o
-rw-r--r-- 1 xyz xyz 11M Oct 21 14:09 build/lib/CMakeFiles/PULSAR_OBJECT_LIB.dir/MultiTopicsConsumerImpl.cc.o
-rw-r--r-- 1 xyz xyz 11M Oct 21 14:09 build/lib/CMakeFiles/PULSAR_OBJECT_LIB.dir/ProducerImpl.cc.o
-rw-r--r-- 1 xyz xyz 7.4M Oct 21 14:08 build/lib/CMakeFiles/PULSAR_OBJECT_LIB.dir/HTTPLookupService.cc.o
-rw-r--r-- 1 xyz xyz 6.6M Oct 21 14:09 build/lib/CMakeFiles/PULSAR_OBJECT_LIB.dir/Url.cc.o
-rw-r--r-- 1 xyz xyz 6.5M Oct 21 14:08 build/lib/CMakeFiles/PULSAR_OBJECT_LIB.dir/BinaryProtoLookupService.cc.o
-rw-r--r-- 1 xyz xyz 6.0M Oct 21 14:09 build/lib/CMakeFiles/PULSAR_OBJECT_LIB.dir/PartitionedProducerImpl.cc.o
```
The top 10 largest objects all include the `PulsarApi.pb.h`.
The main cause is the protobuf-generated files are too large and the header is unnecessarily included in many headers.
```bash
$ wc -l generated/lib/PulsarApi.pb.h
29866 generated/lib/PulsarApi.pb.h
$ wc -l generated/lib/PulsarApi.pb.cc
29393 generated/lib/PulsarApi.pb.cc
```
We should avoid the direct includes on `PulsarApi.pb.h` as much as possible, which increases the binary size and compilation time.
Another problem is that the forward declarations are not common used in the project, which does not only applies for `PulsarApi.pb.h`. When some header files are modified, many source files needs to be recompiled. It really harms the develop experience.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar-client-cpp] merlimat closed issue #60: Improvements on building the project
Posted by GitBox <gi...@apache.org>.
merlimat closed issue #60: Improvements on building the project
URL: https://github.com/apache/pulsar-client-cpp/issues/60
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org