Interface Json.Writable

Enclosing class:
Json

public static interface Json.Writable

A value that knows how to write itself as JSON.

The point of this interface is to let generated code skip the Map. A codec emitted by the annotation processor knows its field names and types at build time, so it can write straight into the sink; without somewhere to hang that, a handler's return value has to become a LinkedHashMap first and be walked back with instanceof dispatch per value. Measured on the benchmark's one-field object, just removing the per-request map was worth 22%.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
  • Method Details