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/05/05 03:31:35 UTC

[GitHub] [pulsar] merlimat opened a new pull request, #15442: [C++] Link with protobuf-lite to reduce binary size

merlimat opened a new pull request, #15442:
URL: https://github.com/apache/pulsar/pull/15442

   ### Motivation
   
   Since we have always used `option optimize_for = LITE_RUNTIME` in `PulsarApi.proto`, we should also link with the `protobuf-lite.a` library when linking statically, as it will reduce the overall size of the `libpulsar.a` that includes all the dependencies.
   
   Example of size diff: 
   
   ```
   $ ll -h /opt/homebrew/Cellar/protobuf/3.19.4/lib/libprotobuf*.a
   -r--r--r--  1 mmerli  admin   874K Jan 28 08:41 /opt/homebrew/Cellar/protobuf/3.19.4/lib/libprotobuf-lite.a
   -r--r--r--  1 mmerli  admin   4.0M Jan 28 08:41 /opt/homebrew/Cellar/protobuf/3.19.4/lib/libprotobuf.a
   ```


-- 
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


[GitHub] [pulsar] BewareMyPower commented on pull request #15442: [C++] Link with protobuf-lite to reduce binary size

Posted by GitBox <gi...@apache.org>.
BewareMyPower commented on PR #15442:
URL: https://github.com/apache/pulsar/pull/15442#issuecomment-1119230110

   > I believe that in many cases, this would not be working:
   > 
   > ```c++
   > PULSAR_PUBLIC SchemaInfo createProtobufNativeSchema(const google::protobuf::Descriptor* descriptor);
   > ```
   > 
   > because the `Descriptor` symbol is hidden and not accessible from the application code.
   
   The protobuf dependency must be imported to use protobuf native schema, so the symbol could be imported from protobuf.
   
   ```c++
   const auto schemaInfo = createProtobufNativeSchema(::proto::TestMessage::GetDescriptor());
   ```
   
   What I concerned is if we imported the protobuf-lite dependency, is there any conflict with the user provided protobuf dependency?


-- 
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


[GitHub] [pulsar] tisonkun commented on pull request #15442: [C++] Link with protobuf-lite to reduce binary size

Posted by GitBox <gi...@apache.org>.
tisonkun commented on PR #15442:
URL: https://github.com/apache/pulsar/pull/15442#issuecomment-1311410084

   Closed as the development of the C++ client has been permanently moved to https://github.com/apache/pulsar-client-cpp.


-- 
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


[GitHub] [pulsar] merlimat commented on pull request #15442: [C++] Link with protobuf-lite to reduce binary size

Posted by GitBox <gi...@apache.org>.
merlimat commented on PR #15442:
URL: https://github.com/apache/pulsar/pull/15442#issuecomment-1119098807

   > I think we should still keep the regular protobuf version to support protobuf native schema. The lite version doesn't support serializing to or from `google::protobuf::Descriptor`.
   
   Uhm, I think there's a problem with the way the descriptor is currently exposed. In the dynamic library, we're generally including all the dependencies, in order to create a dependency-less libpulsar.so. All the symbols of the dependencies are hidden inside, to avoid conflict with other versions of same libraries. 
   
   I believe that in many cases, this would not be working: 
   
   ```cpp
   PULSAR_PUBLIC SchemaInfo createProtobufNativeSchema(const google::protobuf::Descriptor* descriptor);
   ```
   
   because the `Descriptor` symbol is hidden and not accessible from the application code.


-- 
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


[GitHub] [pulsar] BewareMyPower commented on pull request #15442: [C++] Link with protobuf-lite to reduce binary size

Posted by GitBox <gi...@apache.org>.
BewareMyPower commented on PR #15442:
URL: https://github.com/apache/pulsar/pull/15442#issuecomment-1118140989

   I think we should still keep the regular protobuf version to support protobuf native schema. The lite version doesn't support serializing to or from `google::protobuf::Descriptor`.


-- 
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


[GitHub] [pulsar] tisonkun closed pull request #15442: [C++] Link with protobuf-lite to reduce binary size

Posted by GitBox <gi...@apache.org>.
tisonkun closed pull request #15442: [C++] Link with protobuf-lite to reduce binary size
URL: https://github.com/apache/pulsar/pull/15442


-- 
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


[GitHub] [pulsar] github-actions[bot] commented on pull request #15442: [C++] Link with protobuf-lite to reduce binary size

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #15442:
URL: https://github.com/apache/pulsar/pull/15442#issuecomment-1146963260

   The pr had no activity for 30 days, mark with Stale label.


-- 
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