[Openstreetmap-dev] Source overview

Mikel Maron mikel_maron at yahoo.com
Mon Dec 5 20:23:53 GMT 2005

--- Nick Whitelegg <Nick.Whitelegg at solent.ac.uk> wrote:
> >+ ruby may be overkill for generating tiles. just running gpx.rbx or
> >streets.rbx on its own takes overly long -- even "+" is implemented
> as
> >an OO method in ruby. I implemented the same code in perl/GD and
> there
> >was a significant speedup, but still not great - there's the initial
> >compile/startup cost. Perhaps we should be looking at something with
> as
> >little overhead as possible - like C.
> Can't really comment on Ruby but PHP/GD is adequately fast as long as
> there
> aren't too many streets in the current area. I suspect though that
> optimising the database queries (something I didn't spend a lot of
> time on)
> would help though.
The database queries are pretty fast. With the Ruby profiler (not sure
how much I trust it though) most of the time was spent in the math
functions and iterating through the results.

> Is C used much these days for web apps? One disadvantage with C over
> an
> Apache module is the need to launch a separate process -- I haven't
> seen
> any compelling evidence on the web to use C over a scripting
> language.

Generally not for web apps. But tile generation is different .. an
intensive, iterative task. Check out these benchmarks on the Mandlebrot

It is possible to write an apache handler, compile code directly into

> >I tried ImageMagick over Cairo. Even with the kludge of saving out
> to
> >a file, Cairo is slightly faster than ImageMagick. GD I suspect is
> >better than both.
> One thing I could do on the dev machine with very little effort is to
> convert my existing Freemap code to work with OSM - that uses PHP and
> GD.

Sure, worth some investigation, benchmarking.

> >+ There are ways to get Mapserver talking directly to mysql, with
> >Mapserver rendering the geometries directly. This could be very very
> >good, but will require some MapScript coding to test.
> Have had negative feedback from Steve on Mapserver regarding
> bloatedness.
> Without knowing much about Mapserver, might this also reduce
> flexibility,
> you're effectively scripting Mapserver rather than using a general
> purpose
> language to speak to the database direct?

Mapscript is a PHP interface (with perl, ruby and other flavors) to
Mapserver. I would bet it can render tiles very fast, even if bloated
otherwise -- would be good to profile on the dev machine.


More information about the dev mailing list