[Sugar-devel] Rationale behind the JSON -> CJSON switch in Sugar codebase?

Jonas Smedegaard dr at jones.dk
Thu Nov 19 11:27:38 EST 2009


On Thu, Nov 19, 2009 at 04:01:55PM +0100, Tomeu Vizoso wrote:
>On Thu, Nov 19, 2009 at 15:53, Jonas Smedegaard <dr at jones.dk> wrote:
>> On Thu, Nov 19, 2009 at 03:11:05PM +0100, Tomeu Vizoso wrote:
>>>
>>> 2009/11/13 Sascha Silbe <sascha-ml-ui-sugar-devel at silbe.org>:
>>>>
>>>> On Fri, Nov 13, 2009 at 10:12:11AM +0000, Daniel Drake wrote:
>>>>
>>>>>> As Tomeu mentions, Python 2.6 reduces the cjson/json performance 
>>>>>> advantage.
>>>>>
>>>>> OK, didn't see this. Yes, using python standard library seems like 
>>>>> the way to go.
>>>>
>>>> Unfortunately not all distros ship Python 2.6 yet, most notably 
>>>> Debian. So we need to at least fall back to simplejson for those.
>>>
>>> Sounds good to me, so maybe we can ask for a minimum of 2.6 for 
>>> 0.88? How well that plays with Debian and its derivatives?
>>
>> I recommend you to not tune into specific needs of Debian or other
>> particular distros, but aim generally at the FLOSS world.
>>
>> Generally, the faster you tighten the requirements, the more do you
>> discourage the use of long-term supported systems.  Which is bad for
>> deployers, especially those with few resources!
>>
>> So please include fallbacks when using features available only in newer
>> backend libraries.  Not to play nice with Debian, but to play nice with
>> "slow movers".
>
>I see the value in playing nice with "slow movers" but there's also a 
>cost to be paid by both upstream and other distros, so if we can get a 
>better idea of what we actually gain, we can better find the sweetest 
>spot between old and recent dependencies.

I am aware that it is a bigger burden on upstream (i.e. you guys) to 
support a wider range of libraries.  This particular case does not sound 
like a much bigger burden, however: you need to figure out the 
workaround anyway for current releases, it is just a matter of how long 
you maintain it.

I fail to see how any distro will be hurt by you providing fallbacks - 
distros using newer libraries get the speed gains of those, without 
penalties of the fallbacks, no?

I recommend you to add a note in INSTALL file in the tarballs of code 
containing simplejson fallbacks to mention that the code _support_ 
Python 2.5 and newer, is _tested_ mainly on Python 2.6, and that you 
_encourage_ using Python 2.6 or newer due to known speed penalties of 
workarounds when using Python 2.5.

Sure, you can add such notes on web pages too, but I still recommend to 
use the common place for distributors to look for install-related notes 
which is an INSTALL file in the root of the tarball.


Oh, and in case you misunderstood me (why else call it "other distros"): 
I explicitly talked about *deployers* as slow movers, not distros.  
Debian, as an example (and only that, I am not comparing distros here!), 
is in no way slow if you (as deployer) choose to follow the "testing" 
branch. Similarly Fedora is _very_ slow if (as deployer) you are using 
quite old release of that distro - as is the case with OLPC and many 
XO-1 deployments as I understand it.


  - Jonas

-- 
* Jonas Smedegaard - idealist & Internet-arkitekt
* Tlf.: +45 40843136  Website: http://dr.jones.dk/

  [x] quote me freely  [ ] ask before reusing  [ ] keep private
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
Url : http://lists.sugarlabs.org/archive/sugar-devel/attachments/20091119/539d5050/attachment.pgp 


More information about the Sugar-devel mailing list