Return-Path: Delivered-To: apmail-incubator-couchdb-dev-archive@locus.apache.org Received: (qmail 37819 invoked from network); 27 Aug 2008 20:17:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 27 Aug 2008 20:17:42 -0000 Received: (qmail 79968 invoked by uid 500); 27 Aug 2008 20:17:40 -0000 Delivered-To: apmail-incubator-couchdb-dev-archive@incubator.apache.org Received: (qmail 79927 invoked by uid 500); 27 Aug 2008 20:17:39 -0000 Mailing-List: contact couchdb-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: couchdb-dev@incubator.apache.org Delivered-To: mailing list couchdb-dev@incubator.apache.org Received: (qmail 79907 invoked by uid 99); 27 Aug 2008 20:17:39 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Aug 2008 13:17:39 -0700 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [209.68.5.17] (HELO relay03.pair.com) (209.68.5.17) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 27 Aug 2008 20:16:42 +0000 Received: (qmail 77083 invoked from network); 27 Aug 2008 20:17:09 -0000 Received: from unknown (HELO ?192.168.1.149?) (unknown) by unknown with SMTP; 27 Aug 2008 20:17:09 -0000 X-pair-Authenticated: 96.33.90.152 Message-Id: <28CEB9F7-AE1F-4267-92B6-5FD7AB1A9179@apache.org> From: Damien Katz To: couchdb-dev@incubator.apache.org Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v926) Subject: json term changes Date: Wed, 27 Aug 2008 16:17:09 -0400 X-Mailer: Apple Mail (2.926) X-Virus-Checked: Checked by ClamAV on apache.org I've checked in the json_term_changes branch today. Big thanks to Chris Anderson (jchris) as this is mostly his work. The new term format is: json_string() = binary() json_number() = integer() | float() json_array() = [json_term()] json_object() = { [{json_string(), json_term()}] } json_term() = json_string() | json_number() | json_array() | json_object() The main purpose with these changes are: 1. Less memory. The new json terms use binary strings instead of list strings, this makes each JSON string is now about 1/8 the size in memory. 2. To use the "blessed" term format. Among Erlang principals, this format has been decided upon as standard term format for representing JSON in Erlang. The means we should benefit from a wider range of Erlang Json libraries sharing the same format, and much faster parsing as there is now a proposal to create Erlang built-in functions for parsing and producing json using this term format. Everything should continue work identically for clients, there are no semantic changes here. However, this does break existing databases at the file level, so you'll have to dump, upgrade and recreate your existing databases. These changes individually are mostly minor, but they are numerous and touch a lot of the code base. I'd appreciate any time people can spend looking at the changes and testing the code. Comments and criticisms welcome. Hopefully we can get this merged into trunk quickly. -Damien