-
Notifications
You must be signed in to change notification settings - Fork 231
Minimize third-party dependencies #516
Comments
Can I work on this issue? |
It's yours! The first step is to list all the dependencies that are brought when a client application depends on the http://opentracing.io/ If you need any assistance, do let me know, either here or Gitter. Good luck! |
First I created a simple java project and analyzed the dependencies with: mvn dependency:tree > dependencies.log The output of this command was:
I wanted to compare the resolution of dependencies with an android application, so I created this android project Then I analyzed the dependencies with: gradle app:dependencies The output of this command was:
The dependencies are the same in maven java project and android with gradle, and the list of the non duplicates dependencies are:
I need some advice about the next step, especially with the ideas related to change thrift and the possible protobuf serialization. |
This is really great work, @gsoria! Some of these dependencies are transitive dependencies, like Based on your report, it looks like we have a dependency only on the following external artifacts:
I would say that the dependency on The next step then is to see how dependent are we on those three artifacts and how easy it would be to remove that. For instance, I have the impression that the GSON library is used only in one place. So, I think it would make sense to have a simple report, listing the places where each library is used and your personal impression on how easy would it be to replace them. |
Thanks @jpkrohling, I will be working on that! |
I have reviewed the codebase and these are my findings:
The library okhttp is used in Another option can be using httpclient, because it is in fact a transitive dependency of org.apache.thrift:libthrift.
This dependency is used for the following scenarios: A. To serialize a Map to Json, in converters related to Zipkin:
B. To deserialize the JSON payload of the response in: HttpSamplingManager HttpBaggageRestrictionManagerProxy I think the serialization from scenario A can be done manually, but in the scenario B, considering that the response of the request is encoded in JSON, it is best to keep a parser.
Is used in these classes: Test And many classes automatically generated by thrift in jaeger-thrift/src/main/gen-java. I think this dependency is the library on which we depend the most, because changing it would imply redefining the transport and the data model for both the client and the backend side. |
Thanks @gsoria, I think your assessment is spot on. We could leave the decision about replacing the About GSON: we are bringing about 230K to deserialize the JSON payloads. This may be a fair price to pay, as Java 6 has no standard JSON APIs, but I think this payload may be actually very simple. It would be nice to see what are the other alternatives here. How do the payloads look like? Are they simple JSONs? If so, we may be able to get away with a simple tokenizer, even if the performance isn't that good, given that these places are not in the critical path. |
Thanks @jpkrohling I will be analyzing the alternatives related to gson. |
@gsoria , please record your contribution (if you haven't done so yet) on Outreachy's website before the deadline, which is tomorrow Tuesday, October 30, 2018 4pm UTC. Thanks! |
@jpkrohling I already did it, thank you! |
Could it be that the |
We only use thrift for encoding the payload, not for http. So yes, if it has transitive deps we may be able to exclude them. |
See jaegertracing#516 Signed-off-by: Thomas Weißschuh <thomas.weissschuh@de.amadeus.com>
Partially address #516 Signed-off-by: Thomas Weißschuh <thomas.weissschuh@de.amadeus.com>
See opentracing/opentracing-java#296 (comment)
Related: opentracing/opentracing-java#300
Related: #84
This library depends on some third-party libraries, which might reduce the places where Jaeger would run. Ideally, we would ship only with that is absolutely required.
This task might be done as a standalone task, as part of the Performance tests, or as part of the Android tasks.
The text was updated successfully, but these errors were encountered: