Skip to content
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

deriveConfiguredCodec extremely slow compared to deriveCodec #2068

Open
beem812 opened this issue Dec 8, 2022 · 0 comments
Open

deriveConfiguredCodec extremely slow compared to deriveCodec #2068

beem812 opened this issue Dec 8, 2022 · 0 comments

Comments

@beem812
Copy link

beem812 commented Dec 8, 2022

In an attempt to reject payloads with extra fields our project brought in the circe extras library and replaced our standard semi-auto codecs with the extras semiauto deriveConfiguredCodec. The result is that our compile times have effectively tripled.

The code for the configuration looks like this:

package <our package>

import io.circe.generic.extras.Configuration

object CirceConfig {
  val strictJson: Configuration = Configuration.default.withStrictDecoding
  implicit val implicitStrictJson: Configuration = strictJson
}

the usage sight looks like:

import <our package>.CirceConfig.implicitStrictJson


case class Foo(bar: Bar)
object Foo {
  implicit val circe = deriveConfiguredCodec[Foo]
}

is this slower derivation expected given that we're using a codec with configuration?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant