سؤال

Currently I am in the process of analyzing the pros and cons of producing a JSON output in different formats. What, according to you, would be the pros and cons of a JSON output with pretty print and the one without any formatting related to pretty printing with respect to stuff like

  1. Performance.

  2. Serialization/Deserialization.

  3. Parsing or any other criteria.

I am using Java.

هل كانت مفيدة؟

المحلول

For all three points you mention, it is better not to use pretty printing. The only advantage of pretty printing is that it is easer to read by a human.

نصائح أخرى

Without doing any kind of profiling, I would think that having no extra whitespace would be better for performance, if only marginally. It would save some bandwidth though.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top