Skip to content

Performance regression in 2.2.3 #148

Closed
@gianm

Description

@gianm

Version 2.2.3 does untyped deserialization dramatically slower (about 150x in the benchmark I am using) than 2.2.2. I'm testing with a json object that has a few levels of nesting (maps within maps; some keys are lists too) with a loop that looks like this:

  def timeJacksonJava(reps: Int) = {
    var ret: Seq[AnyRef] = null
    val jm = new ObjectMapper
    for (i <- 0 until reps) {
      val xs = bytess map (jm.readValue(_, classOf[AnyRef]))
      if (ret == null) {
        ret = xs
      }
    }
    ret
  }

  def timeJacksonScala(reps: Int) = {
    var ret: Seq[AnyRef] = null
    val jm = new ObjectMapper()
    jm.registerModule(DefaultScalaModule)
    for (i <- 0 until reps) {
      val xs = bytess map (jm.readValue(_, classOf[AnyRef]))
      if (ret == null) {
        ret = xs
      }
    }
    ret
  }

bytess is a Seq[Array[Byte]] where each byte array is a json object on the order of a few kb. jackson-module-scala 2.2.2 runs roughly the same speed as jackson itself, but 2.2.3 is much slower.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions