question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Performance issue in TastyUtil::hasTastyFile when using Java classes

See original GitHub issue

Hey, after I upgraded to a newer jackson version, I saw a lot of weird timeouts in our unit tests which should finish immediately.

After inspection I found this tasty_trace

It seems like it checks if the class has a tasty file by operating on the the jar files which is a very costly operation if we assume that this is a cpu bound operation.

https://github.com/FasterXML/jackson-module-scala/blob/2.14/src/main/scala/com/fasterxml/jackson/module/scala/util/Classes.scala#L10-L12

It seems like this code path will always hit for classes defined in java(not scala classes), because the first two checks will always be false.

The tests succeeds if I add a retry, so I assume the result of this operation is cached? Maybe it is possible to do val extendsScalaClass ?

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:22 (11 by maintainers)

github_iconTop GitHub Comments

3reactions
pjfanningcommented, May 17, 2022

I did some testing and for non-Scala classes, there is no caching of the introspection results - meaning the work is duplicated on subsequent calls - I have added https://github.com/FasterXML/jackson-module-scala/pull/578 and it will be released when v2.14.0 is released

1reaction
wix-andriusbcommented, Sep 26, 2022

Thanks for clarifying, you guys are fast 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Top 10 most common Java performance problems
Top 10 most common Java performance problems. 3. My career in performance began, as you might guess, with a catastrophe. I was working...
Read more >
Java performance monitoring | New Relic
Learn how to improve the performance of your Java applications by optimizing your code and using a performance monitoring tool.
Read more >
Performance Effects of Exceptions in Java - Baeldung
This tutorial will prove that this perception is correct and pinpoint what causes the performance issue. 2. Setting Up Environment.
Read more >
Java class loading – performance impact! - Fast thread
This problem can be short-circuited, if we can load the class only once during application startup time. This can be achieved by modifying...
Read more >
Classloader-Releated Memory Issues - Dynatrace
However, in Java classes, objects are managed on the heap, as well. ... memory demand without any added value and can lead to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found