3 ms·
Of the three formats I support, RSS, Atom, and JSON, the RSS feed is the smallest. RSS: 33,228 Atom: 43,433 JSON: 36,137
by spc476 8y ago
Of the three formats I support, RSS, Atom, and JSON, the RSS feed is the smallest.
RSS: 33,228
Atom: 43,433
JSON: 36,137
- oliwarner 8y agoI'll be honest —and it'll make me sound like an arrogant dbag— but that doesn't pass my sniff test. "jsonfeed" is lighter than equivalent RSS for several small reasons. Can I see? (To be clear to anybody reading this out of context: I'm not claiming that JSON is best —far from it— just that I would expect it to be a few bytes lighter in transit.)
- spc476 8y agoSure. http://boston.conman.org/index.atom http://boston.conman.org/index.json http://boston.conman.org/bostondiaries.rss Each one contains the full text of the past 15 entries.
- oliwarner 8y agoThank you for sharing that. It took me a little while before I noticed it, but your JSON files have more data. Each item has a id, date_published and tags field which do not feature in the RSS. Together these account for around 250chars per item or 3750chars per 15 item feed. Cut out those fields and the JSON would be 850chars shorter. Also, you're preserving tab and newline characters around HTML. This affects JSON more because a newline is valid between RSS tags. In JSON a newline becomes two characters "\n", as a tab becomes "\t". Going "spaceless" on output would save you 1372chars from your JSON feed (and half as much from RSS/ATOM). I will confess, my sniff test didn't account for using quite as many HTML attributes as you do :) Escaping double-quotes costs you 334 in JSON. The overall difference is much slighter than I had expected.