[Chameleon] more speed for loading map

Paul Spencer pspencer at dmsolutions.ca
Sun Oct 24 10:48:15 EDT 2004


Mickel,

Chameleon has a fixed overhead regarding drawing maps.  In profiling 
this, my results have shown that there is approximately 50-100ms 
overhead in Chameleon.  The remaining time to draw a map is mapserver.

This is not to say that Chameleon may not be causing problems, but it is 
sufficiently complex now that to say something is slow is not very 
helpful in determining the cause.  The first step in diagnosing the 
problem should be to test your mapfile directly with mapserver and 
determine how long it takes.  If Chameleon takes substantially longer, 
then this is the right place to ask.  Otherwise, I would suggest the 
guru's on the mapserver list ... they know lots about optimizations of 
data etc

To test your mapfile directly, you can run it against a cgi with 
mode=map or through a small php script such as:

<?php
dl( 'php_mapscript_42.'.PHP_SHLIB_SUFFIX );

$time_start = microtime_float();
$oMap = ms_newMapObj( '<path to mapfile>' );
$time_end = microtime_float();
$time = $time_end - $time_start;
echo "map took $time seconds to load<BR>";

//this is the the step you really want to time ...
$time_start = microtime_float();
$oImage = $oMap->draw();
$time_end = microtime_float();
$time = $time_end - $time_start;
echo "map took $time seconds to draw<BR>";

$time_start = microtime_float();
$szURL = $oImage->saveWebImage();
$time_end = microtime_float();
$time = $time_end - $time_start;
echo "map took $time seconds to save<BR>";

echo "<img src=$szURL>";

function microtime_float()
{
    list($usec, $sec) = explode(" ", microtime());
    return ((float)$usec + (float)$sec);
}
?>

For the chameleon.map file that comes with Chameleon running on my local 
machine, I get:

map took 0.30585694313 seconds to load
map took 0.621891021729 seconds to draw
map took 0.144242048264 seconds to save

Note that there is another factor here, which is transferring the image 
from the web server to your browser.

Cheers,

Paul

mickel delay wrote:
> Dear list
> Hi,
> i have an ecw file(file size is 80 MB) in my server
> and i use from chameleon for loading it(ms4w version
> 9).
> How i can take more speed for loading my map in
> chameleon application.
> 
> regards 
> mickel.
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> _______________________________________________
> Chameleon mailing list
> Chameleon at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/chameleon
> 


More information about the Chameleon mailing list