I've never really used the DSL to construct larger objects (usually I'm reading them in, so
parsing, or decomposing a case class), but this definitely looks like it would be an issue.
Unfortunately lift-json has a built-in usage of List that's rather endemic in older Scala
libraries but can be quite costly as a decision in certain cases like this one. Since the List
is part of the public interface, it gets complicated to change without introducing additional
performance surprises.
In the meantime, the best approach is probably to avoid the DSL when building an object
with enough fields that your performance starts to suffer. The DSL operates on basic lift-json
data structures, so I think you can do this for just the pieces that need it.
Thanks,
Antonio