[erlang-questions] Why EEP-0018 "JSON bifs" (and conforming libraries) are "wrong" about object encoding (i.e. `[{}]`)

Chris Pacejo colanderman@REDACTED
Wed Aug 27 21:48:43 CEST 2014

On Wed, Aug 27, 2014 at 2:03 PM, Josh Adams <josh.rubyist@REDACTED> wrote:
> I would assume this isn't true until maps are fast with a large number of
> keys though...would that be accurate?  I definitely have plenty of json use
> cases that would likely perform poorly until that change occurs.

I would never expect the general case of accessing data stored in the
same logical structure it's transmitted on the wire in to be fast at

Think about it: real-world large data is typically relationally rich.
Large datasets should be indexed in multiple ways to support efficient
access, and this indexing is by its very nature (a) domain-specific
and (b) informationally redundant.

But when sending this data on the wire, you want it to be *compact*,
not richly indexed.  So to support efficient access, you inevitably
need to restructure the data coming off the wire *anyway*.  (Not to
mention that not restructuring data couples both sides of your
implementation to the wire format and to each other, making it brittle
in the face of future changes.)

More information about the erlang-questions mailing list