-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Poor performance when upgrading from 2.12.2 to 2.13.3 #3636
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
/cc @pjfanning Ok, this is obviously unfortunate. Since it involves Scala module this might belong under However, looking at flame graphs it looks like the difference comes down to 2.13 spending all/most of its time introspecting Bean property to find serializer annotated with I am guessing that somehow serializer being used is not being cached with 2.13 but is with 2.12. I don't think logic or amount of introspection has changed. But to track it any further it'd probably be necessary to have a more isolated test case. That could help figure out a work-around, perhaps, or point to possible improvement in |
Sounds like FasterXML/jackson-module-scala#576 to me - which is fixed in v2.14.0-rc1 and v2.14.0-rc2. |
@pjfanning Interesting! Good point about checking out 2.14.0-rc2 to see if that might help; there are many fixes that could help here. @hoshibara I would suggest you try out version |
Thanks for your replies, I have tested |
@hoshibara thank you for verifying this. It could be useful to see flamegraphs for 2.14.0-rc2 if those were possible to reproduce? We are very close to final 2.14.0 release but perhaps it would be possible to find other improvements before that. At this point this is the only report we have received for significant performance degradation and it would be good to resolve. |
@cowtowncoder Thanks for such a quick reply, I can only try to get the flamegraphs for I try to get a new group of flame graphs including rc2's. |
@hoshibara one possibility is that the ScalaAnnotationIntrospectorModule._scalaTypeCache is not big enough for your needs. You can use this method to update the cache:
|
@pjfanning I tried the solution you provided, but the handling time is still about 76ms. |
From 2.14 flamegraphs (like "214rc2-cpu.html") I now see About the only thing I wonder is whether there is any chance that Scala module version was different (not 2.14.0-rc1 or rc2). |
I checked the |
In 2.14.0-rc2+6-6152ff2e-SNAPSHOT version of jackson-module-scala, there is a new setting to disable the TastyUtil. FasterXML/jackson-module-scala@ff1bc44 ScalaAnnotationIntrospectorModule.supportScala3Classes(false) I still need to add some test coverage for this |
Describe the bug
When serializing an object to JSON, the serialization time increases with the number of jars in the classpath.
I find this issue while upgrading jackson-databind and jackson-module-scala_2.12 from 2.12.2 to 2.13.3.
Version information
2.13.3
To Reproduce
If you have a way to reproduce this with:
JacksonTestServer.java:
JacksonHTTPService.java
IDProbList.java
serializers.scala
pom.xml
./jersey
includes:./spark-3.12-bin-hadoop2.7
isextracted from spark-3.12-bin-hadoop2.7.tgzI packaged this project as jar and test use these commands:
jackson 2.12.2
jackson 2.13.3
jackson 2.13.3 remove spark
At first, I thought that a specific jar in spark would cause the extra delay. But after I split all the jars in spark into two parts randomly and only import one part, the performance improved compared to importing all the packages.
I repeated the segmentation several times and found that the delay is proportional to the number of imported jars.
I also use arthas to sample some profilers. Hope to help locate the problem.
profilers.zip
Expected behavior
Reduce the extra serialization time caused by importing jar packages
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: