[Featureserver] simplejson version

Brent Pedersen bpederse at gmail.com
Tue Mar 10 11:57:49 EDT 2009


On Tue, Mar 10, 2009 at 8:27 AM, Yves Moisan <yves.moisan at boreal-is.com> wrote:
>
>>
>> I would say that if you really want speed though, you should use cjson.
>
> So that would mean editing all lines like "from simplejson ..." to "from
> cjson ..." right?
>
> IIRC there is a way to conditionally import ctypes (or was it
> cString ??) and if not fall back on Python types/strings (can't remember
> the syntax).  Wouldn't that be applicable here so that people don't have
> to edit Python files in FS if they want to use cjson ?  Or is there a
> different fetaureset in cjson that makes it less desirable than
> simplejson as a default choice ?  I read that slashes are not handled
> the same in both libraries ...
>
> Yves
>
> _______________________________________________
> Featureserver mailing list
> Featureserver at openlayers.org
> http://featureserver.org/mailman/listinfo/featureserver
>

fwiw,
in my exp recent versions of simplejson are at least "nearly as fast"
as cjson (within 10%) --using the c extensions in both.
for the import, you can see how it's done in vector formats:
http://svn.featureserver.org/trunk/vectorformats/vectorformats/Formats/GeoJSON.py

-brentp



More information about the Featureserver mailing list