Opened 19 years ago

Closed 13 years ago

#1224 closed defect (wontfix)

MapServer performance issue drawing gmap map

Reported by: dmorissette Owned by: jlacroix
Priority: high Milestone:
Component: MapScript-PHP Version: 4.4
Severity: normal Keywords:
Cc: pspencer@…, woodbri@…, bartvde@…

Description (last modified by tbonfort)

Paul brought up an interesting question: why is this script so slow?

<?php
dl( 'php_mapscript_44.so' );
$oMap = ms_newMapObj("/home/daniel/proj/msapps/gmap/htdocs/gmap75.map");
$oImg = $oMap->draw();
$szURL = $oImg->saveWebImage();
echo "<img src=$szURL>";
?>

real    0m0.794s
user    0m0.583s
sys     0m0.033s

I seem to remember that GMap was drawing its map in more or less the same time
on very slow hardware 3-4 years ago. The times above are on a relatively recent
and fast Linux machine. Is MapServer becoming fat and slow?

Assigned to Julien to try to shed some light on this. Perhaps start by comparing
with performance of older versions, and also try some profiling.

Change History (9)

comment:1 by jlacroix, 19 years ago

Status: newassigned
MapServer 4.4 (and probably 4.2) is slower than 4.0. We have a performance lost
of about 20%.
with MapServer 4.0 the php_mapscript draw function took around 0.23 sec to
complete and 0.29 with Mapserver 4.4.

With some more investigation with gprof and mapserver CGI (4.0 vs 4.5), it seems
that the biggest performance lost is in the GD function: gdImageColorResolveApha
In 4.0 it took 0.38 sec of 1.66 total.
In 4.5 it took 0.64 sec of 1.80 total.

I continue the investigation

comment:2 by jlacroix, 19 years ago

dependson: 1243

comment:3 by sdlime, 19 years ago

Cc: steve.lime@… added

comment:4 by sdlime, 19 years ago

We can't afford to become that much slower between versions. It's the one 
thing that has set MapServer apart in the past. Please post profiling results 
here...

Steve

comment:5 by jlacroix, 19 years ago

dependson: 1244

comment:6 by jlacroix, 19 years ago

I made a lot of profiling in mapserver for this bug. My tests were based on 50
consecutive call to mapserv CGI 4.0 and 4.5. I used the gmap mapfile. My
profiler as gprof.

This gave me the following result:
4.0: 6.18 sec for 50 requests.
4.4: 7.56 sec for 50 requests.
This gives a diference of 1.38 sec.

In that, I found that the main differences were in a GD function
(gdImageStringFT in msDrawTextGD) (1.66 sec with 4.0 vs 2.51 sec with 4.4), and
in all access to points object (around 0.45 sec lost overall).

The lost in msDrawTextGD is due to 7 calls to gdImageStringFT instead of 3 calls
in 4.0.  This problem will be discussed in bug 1243.

The lost of performance due to point objects manipulation is due to the addition
of the z parameter in the point object. A solution for this will be discussed in
bug 1244.

I made a test by resolving both issue like proposed in the two bugs and it end
with this result:
4.4: 6.20 sec for 50 requests
4.0: 6.52 sec for 50 requests

comment:7 by woodbri@…, 19 years ago

Cc: woodbri@… added

comment:8 by bartvde@…, 19 years ago

Cc: bartvde@… added

comment:9 by tbonfort, 13 years ago

Description: modified (diff)
Resolution: wontfix
Status: assignedclosed

we won't be intervening on 4.x performance issues anymore !

Note: See TracTickets for help on using tickets.