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.

Extremely slow compilation when silencer plugin enabled

See original GitHub issue

Next lines of code compiles at least 25 seconds when silencer plugin enabled and just 1 seconds with disabled plugin

import sttp.tapir._

case class Foo(a: Int)

object Main extends App {
  val a = implicitly[Schema[Foo]]
    .modify(_.a)(_.description("foo")) // 1s with silencer and 1s without
    .modify(_.a)(_.description("foo")) // 1s with silencer and 1s without
    .modify(_.a)(_.description("foo")) // 1s with silencer and 1s without
    .modify(_.a)(_.description("foo")) // 1s with silencer and 1s without
    .modify(_.a)(_.description("foo")) // 1s with silencer and 1s without
    .modify(_.a)(_.description("foo")) // 1s with silencer and 1s without
    .modify(_.a)(_.description("foo")) // 1s with silencer and 1s without
    .modify(_.a)(_.description("foo")) // 1s with silencer and 1s without
    .modify(_.a)(_.description("foo")) // 1s with silencer and 1s without
    .modify(_.a)(_.description("foo")) // 1s with silencer and 1s without
    .modify(_.a)(_.description("foo")) // 2s with silencer and 1s without
    .modify(_.a)(_.description("foo")) // 6s with silencer and 1s without
    .modify(_.a)(_.description("foo")) // 16s with silencer and 1s without
    .modify(_.a)(_.description("foo")) // 25s with silencer and 1s without
}

where modify - is macro function from tapir library.

Repo with simple reproducer: https://github.com/igrocki/slow-silencer-tapir

I found ugly workaround: breaking method chain into two or more chains like:

val a = implicitly[Schema[Foo]]
    .modify(_.a)(_.description("foo")) 
    .modify(_.a)(_.description("foo")) 
    .modify(_.a)(_.description("foo")) 
    .modify(_.a)(_.description("foo")) 
    .modify(_.a)(_.description("foo")) 
    .modify(_.a)(_.description("foo")) 

val b = a.modify(_.a)(_.description("foo"))
    .modify(_.a)(_.description("foo")) 
    .modify(_.a)(_.description("foo")) 
    .modify(_.a)(_.description("foo")) 
    .modify(_.a)(_.description("foo")) 
    .modify(_.a)(_.description("foo")) 
    .modify(_.a)(_.description("foo")) 
    .modify(_.a)(_.description("foo")) 

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
ghikcommented, Feb 21, 2020

Ok, I’ve decided to go on and ignore macro expansions by default. I’ve also introduced an option to bring back the old behaviour (-P:silencer:searchMacroExpansions). These changes are available in freshly released 1.6.0

0reactions
adamwcommented, Feb 27, 2020
Read more comments on GitHub >

github_iconTop Results From Across the Web

Extremely slow compilation times - Feedback & Requests
I'm currently working on a UE4 plugin and after making changes in the source files and recompiling the module via the Modules window...
Read more >
scala/scala - Gitter
"paper over" quickly becomes "obscure", see compile and what that means in terms of "just tell me how you're invoking scalac"...
Read more >
Issues · ghik/silencer · GitHub
Contribute to ghik/silencer development by creating an account on GitHub. ... Extremely slow compilation when silencer plugin enabled.
Read more >
Electro-Harmonix Silencer Noise Gate User Reviews
The last thing I would mention is that this pedal doesn't produce any noise of its own and it doesn't click or pop...
Read more >
Top 6 Noise Reduction Plugins 2022 (And 3 Best Free Tools)
5. Crumplepop Audio Denoise AI (Not Compatible with All DAWs) ... WNS noise suppressor is a zero-latency noise reduction plugin that can suppress...
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