[OSM-dev] Semicolon
Dave Stubbs
osm.list at randomjunk.co.uk
Tue Nov 13 15:21:41 GMT 2007
On 13/11/2007, Tom Hughes <tom at compton.nu> wrote:
> In message <a4c775140711130535n512c9cbat432d47f7aeb27597 at mail.gmail.com>
> Dave Stubbs <osm.list at randomjunk.co.uk> wrote:
>
> > Patch attached.
>
> Thanks.
>
> > What it does:
> > - escapes all ';' with '\s'
> > - escapes all '=' with '\e'
> > - escapes all '\' with '\\'
> > - unescapes for requests
> > - works for API and Potlatch
>
> I can't say I'm a great fan of that escaping scheme, but I'll have
> a think and see if I can come up with anything better.
it lets you split on ; and = before you have to do anything else. And
it's unambiguous. I'm not sure what else an escaping scheme should do?
Of course it might be better not to have escaping at all, and do tags
properly as for ways/relations...
>
> > So basically anything that doesn't use the API (either node interface,
> > or amf interface) will fail to properly escape or unescape the ; and
> > =.
>
> Do we have any idea what the performance impact on the map API call
> is? That's an awful lot of (slow) ruby string manipulation that we're
> adding to it...
On my box it doesn't appear to be noticeable.
I ran a test to insert 200 new nodes* using lwp-request, a bash for
loop and time. I ran it 4 times, the first one being straight after
starting the server in production mode.
the real time for the old code was: 17.948 17.825 17.887 17.881
for the new code: 18.316 17.897 17.876 17.825
Obviously YMMV as on my box the db will be comparatively rubbish.
Dave
* The node defined the following tags:
<tag k="somekey1" v="opt1;opt2"/>
<tag k="somekey2" v="opt1=opt2"/>
<tag k="somekey3" v="opt1\opt2"/>
<tag k="amenity" v="fuel"/>
<tag k="highway" v="roundabout"/>
<tag k="source" v="thing:9899809597994"/>
<tag k="thing:id" v="XX:9899809597994"/>
More information about the dev
mailing list