Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MapServer performance issue drawing gmap map #1224

Open
tbonfort opened this issue Mar 28, 2012 · 4 comments
Open

MapServer performance issue drawing gmap map #1224

tbonfort opened this issue Mar 28, 2012 · 4 comments

Comments

@tbonfort
Copy link
Member

Reporter: dmorissette
Date: 2005/02/08 - 20:45

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.
@tbonfort
Copy link
Member Author

Author: jlacroix
Date: 2005/02/09 - 18:54

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

@tbonfort
Copy link
Member Author

Author: sdlime
Date: 2005/02/14 - 21:47

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

@tbonfort
Copy link
Member Author

Author: jlacroix
Date: 2005/02/14 - 22:05

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

@tbonfort
Copy link
Member Author

Date: 2011/04/19 - 10:54
we won't be intervening on 4.x performance issues anymore !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant