MapWindow Developer Team : MapWindow Discussion Forum
The attached file is a pdf file with the results of my performance tests. I have 4 identically (cloned) virtual machines with WinXP Sp3-32Bit 50 GB Hard drive 2 GB Ram 1 processor 2.6 GHz. I've installed on each machine: MapWindow v4.6 SR Map
[Performance-tests] First results
Posted by: pmeems ()
Date: August 04, 2009 01:34PM

The attached file is a pdf file with the results of my performance tests.
I have 4 identically (cloned) virtual machines with WinXP Sp3-32Bit
50 GB Hard drive
2 GB Ram
1 processor 2.6 GHz.

I've installed on each machine:
MapWindow v4.6 SR
MapWindow v4.7 RC1
MapWindow v4.7 RC2
MapWindow v4.7 RC2 with latest patch (weekly build).

The performance test is intended to measure the changes Neio and Sergei are making with the Quadtree implementation: [modification] QuadTree for Edit Mode

This version of the script runs several actions 10 times. The actions are :
Add shapefile to map
Update map
Zooming
Selecting shapes

The total execution time of the script for each version of MapWindow is:
MW4.6      10min 30sec
MW4.7RC1   11min 04sec
MW4.7RC2   10min 48s
MW4.7Patch 11min 24s
As you can see it is not improving.

The next version of the test script will also include
EditInsertShapes
EditDeleteShapes
StartEditingShapes
StopEditingShapes
Close

@Neio: If you've changed or added other methods please let me know and I'll add them to the script.

--
Paul

--
Don't forget to read the new documentation: www.mapwindow.org/documentation/mapwingis4.8
Join us Google+: MapWindow GIS Google+ Community
Join the MapWindow Group on LinkedIn! LinkedIn - MapWindow Group

Download the latest beta installer at:
tinyurl.com/mwMonthly 32-Bit
tinyurl.com/mwMonthlyx64 64-Bit
Follow me on Twitter MapWindow_nl to read when a new installer is published.

---
Paul Meems
The Netherlands
[www.bontepaarden.nl]
Release manager, configuration manager and
forum moderator of MapWindow GIS

Owner of MapWindow.nl - Support for
Dutch speaking users: www.mapwindow.nl

*******
Everything I say or write is my personal opinion and
not the opinion of the company I work for.
*******
View my profile on LinkedIn

Attachments: Quadtree-performance.zip (55.7 KB)  
Options: ReplyQuote
Re: [Performance-tests] First results
Posted by: Sergei ()
Date: August 04, 2009 05:13PM

Paul,

Qtree is not working unless shapefile is in edit mode . Also it's necessary to set UseQTree property of shapefile to true.

These results are rather expected for me. May be we need to analyse decrease of speed between 4.7RC2 and 4.7Patch as I don't see reasons for it (by the way when v4.7RC2 was build?).

Regards,
Sergei

Options: ReplyQuote
Re: [Performance-tests] First results
Posted by: pmeems ()
Date: August 05, 2009 05:39AM

Sergei,

I've added these two methods to my script:
    private static void editMode(IMapWin mapWin, int layerHandle, bool useQTree, bool closeAgain)
    {
        System.Diagnostics.Stopwatch stopWatch = System.Diagnostics.Stopwatch.StartNew();
        MapWinGIS.IShapefile sf = GetShapefileFromMap(mapWin, layerHandle, useQTree);
        if (sf.EditingShapes)
        {
            ReportMessage("Shapefile is already in Edit mode");
        }
        if (sf.StartEditingShapes(true, null))
        {
            stopWatch.Stop();
            ReportMessage("Time needed to StartEditingShapes, useQTree=" + useQTree.ToString()+ ": " + getElapsedTime(stopWatch));
            logToDictionary("StartEditingShapes, useQTree=" + useQTree.ToString(), stopWatch.Elapsed);            
        }
        else
        {
            ReportMessage("Error! StartEditingShapes returned: " + sf.get_ErrorMsg(sf.LastErrorCode));
        }        
        if (!closeAgain) return;
        if (!sf.EditingShapes) return;

        ReportMessage("About to start StopEditingShapes");
        stopWatch = System.Diagnostics.Stopwatch.StartNew();
        if (sf.StopEditingShapes(true, true, null))
        {
            stopWatch.Stop();
            ReportMessage("Time needed to StopEditingShapes, useQTree=" + useQTree.ToString() + ": " + getElapsedTime(stopWatch));
            logToDictionary("StopEditingShapes, useQTree=" + useQTree.ToString(), stopWatch.Elapsed);
        }
        else
        {
            ReportMessage("Error! StopEditingShapes returned: " + sf.get_ErrorMsg(sf.LastErrorCode));
        }

    }

    private static IShapefile GetShapefileFromMap(IMapWin mapWin, int layerHandle, bool useQTree)
    {
        MapWinGIS.IShapefile sf = mapWin.Layers[layerHandle].GetObject() as MapWinGIS.IShapefile;
        if (sf == null)
        {
            throw new Exception("Error in GetObject. Cannot get shapefile from layer handle.\n");
        }
        //Check if property exists:
        Type t2 = sf.GetType();
        System.Reflection.PropertyInfo p2 = t2.GetProperty("Paulus");
        if (p2 == null)
        {
            // property does not exist
            ReportMessage("Property Paulus does not exist.");
        }
        else
        {
            ReportMessage("Property Paulus is available and will be used.");
        }
        if (useQTree)
        {
            //Check if property exists:
            Type t = sf.GetType();
            System.Reflection.PropertyInfo p = t.GetProperty("UseQTree");
            if (p == null)
            {
                // property does not exist
                ReportMessage("Property UseQTree does not exist.");
            }
            else
            {
                ReportMessage("Property UseQTree is available and will be used.");
                sf.CacheExtents = true;
                sf.UseQTree = true;                
            }
        }
        return sf;
    }

They get called after addLayer and refreshMap:
// Go to editmode with using QTree and stop editmode:
editMode(m_MapWin, layerHandle, true, true);

I hope I'm doing it wrong because now my memory use goes sky high.
My swap file is raised from 250MB to 1.2GB and stays that way.
My CPU is going from 5% to 100% and everything in between.
This is my logging so far:
(Quadtree-timing) 5-8-2009 13:24:42 Start of test
(Quadtree-timing) 5-8-2009 13:24:42 MapWinGIS version: 4.7.2 (3-8-2009)
(Quadtree-timing) 5-8-2009 13:24:42 *************** Cycle #0
(Quadtree-timing) 5-8-2009 13:24:51 Time needed to add the shapefile to the map: 00:00:08.108
(Quadtree-timing) 5-8-2009 13:24:53 Time needed to update the map: 00:00:02.825
(Quadtree-timing) 5-8-2009 13:24:53 Property Paulus does not exist.
(Quadtree-timing) 5-8-2009 13:24:53 Property UseQTree is available and will be used.
(Quadtree-timing) 5-8-2009 13:26:14 Time needed to StartEditingShapes, useQTree=True: 00:01:20.295
(Quadtree-timing) 5-8-2009 13:26:15 About to start StopEditingShapes
and it is now 13:33, so it is already 7 minutes working on StopEditingShapes.
I'm using a 1GB VM with the latest SVN version of MapWindow.
Tonight I'll try with the larger test VMs with the different MW versions.

When I open the shapefile manually in MapWindow and open the attribute table is also takes some time to show the table.

It's now 13:35 and the script is still no further. The swapfile is now 795 MB with no fluctuations.

Any thoughts?

PS: Just before posting the script continued with this log message:
(Quadtree-timing) 5-8-2009 13:37:34 Time needed to StopEditingShapes, useQTree=True: 00:11:17.183


Paul

--
Don't forget to read the new documentation: www.mapwindow.org/documentation/mapwingis4.8
Join us Google+: MapWindow GIS Google+ Community
Join the MapWindow Group on LinkedIn! LinkedIn - MapWindow Group

Download the latest beta installer at:
tinyurl.com/mwMonthly 32-Bit
tinyurl.com/mwMonthlyx64 64-Bit
Follow me on Twitter MapWindow_nl to read when a new installer is published.

---
Paul Meems
The Netherlands
[www.bontepaarden.nl]
Release manager, configuration manager and
forum moderator of MapWindow GIS

Owner of MapWindow.nl - Support for
Dutch speaking users: www.mapwindow.nl

*******
Everything I say or write is my personal opinion and
not the opinion of the company I work for.
*******
View my profile on LinkedIn

Options: ReplyQuote
Re: [Performance-tests] First results
Posted by: Sergei ()
Date: August 05, 2009 09:26AM

Paul,

I've just tried manually to start/stop edit mode with cacheExtents = true and UseQtree = true multiple times. Memory usage is slightly growing (1MB each time for 15 MB shapefile).

In edit mode memory usage increases on 88 MB for the same shapefile. I use current version of the ocx and my vb6 program.

What is the size of the test shapefile?
How 4.6 version of ocx behaves itself under this test?

Qtree and CacheExtents are meant to speed up zooming in edit mode. So to test them something like this should be used:

StartEditShapes
Zoom
Zoom
...
StopEditShapes

Regards,
Sergei

Options: ReplyQuote
Re: [Performance-tests] First results
Posted by: pmeems ()
Date: August 05, 2009 03:07PM

Sergei,

In my new test I do first a StartEditingShapes, then 10 times the rest like zooming and selecting and finally I call StopEditingShapes once.

The results I'm getting are not very promising, but also not very precise. I'll need to refine my script so I can do a test without QTree, CacheExtents and SpatialIndex, a test with SpatialIndex and a test with all new features enabled.
I'll modify and run the script tomorrow.

The results of todays run are:
MW4.6 1hour 22min 42s
MW4.7RC1 2hours 39min 12s
MW4.7RC2 51min 35s
MW4.7Patch 2hours 55min 18s

The test shapefile is [svn.mapwindow.org].*
It has 201693 shapes and 52 fields. The total size of the 3 main files are 215MB.
This is a common used file in size and number shapes and fields. MapWindow should be able to handle these kind of files very fast.

The test script can be found here: [svn.mapwindow.org]

Tomorrow another day of testing ;)

Paul

--
Don't forget to read the new documentation: www.mapwindow.org/documentation/mapwingis4.8
Join us Google+: MapWindow GIS Google+ Community
Join the MapWindow Group on LinkedIn! LinkedIn - MapWindow Group

Download the latest beta installer at:
tinyurl.com/mwMonthly 32-Bit
tinyurl.com/mwMonthlyx64 64-Bit
Follow me on Twitter MapWindow_nl to read when a new installer is published.

---
Paul Meems
The Netherlands
[www.bontepaarden.nl]
Release manager, configuration manager and
forum moderator of MapWindow GIS

Owner of MapWindow.nl - Support for
Dutch speaking users: www.mapwindow.nl

*******
Everything I say or write is my personal opinion and
not the opinion of the company I work for.
*******
View my profile on LinkedIn

Attachments: Quadtree-performance.zip (58.5 KB)  
Options: ReplyQuote
Re: [Performance-tests] First results
Posted by: Sergei ()
Date: August 05, 2009 05:40PM

Paul,

Analysis:
Results for v4.6, v4.7RC1, v4.2RC2 seem relevant to me.

I noticed significant decrease of speed between v4.6 v4.7RC1 (I estimated it as "up to 2 times") and we see it here.

After recent changes speed of redraw most likely has incresed - it's v4.7RC2 on graph I expect.

In version v4.7RC2Patch it's obvious that new properties do not work. I don't know why (?wrong file version/property set to false?). Plain redraw time incresed a bit in comparison with RC1 but it makes sense (additional conditions and fixing of a bug with colours of lines and points).

I can't find explanation for very long time on saving 4.7RC2. Maybe I'll look in the code.

Some thoughts:
It doesn't make sense to call UpdateMap(mapWin) in ReadAttribute as time to access cellvalue is very small in comparison to the time of redraw which is called afterwards. So we receive same redraw time as after zoom operations.

In fact we test DrawShapefile function of ocx, and redraw rate depends upon number of units which fall in map extents. Therefore there is no need to vary different zooming functions (ZoomIn, ZoomOut, ZoomToShape, ZoomToMaxExtents).

I'd better test redraw rate at different map scales, for example 1:250000, 1:100000, 1:25000, 1:10000, 1:1000 (for meters). Redraw rate at given scale will depend upon the place of the map (if units distibution is not even). So several places must be tested to have reliable result. Better to choose these places randomly, but they must be the same for all test cases. Then it's good to see an average for the given scale and maybe standard deviation (or variation). I think it's possible to use just one function for zooming/scaling:

SetScale(Scale as double, dx as double, dy as double),
where dx, dy - relative position (ranges from 0 to 1);
X = MaxExtents.Left + (MaxExtents.Right - MaxExtents.Left) * dx
Y = ...

Results for different scales have separate value as QuadTree and SpatialIndex speed up things at large scales (1:1000) but have no use on small scales (1:100000). It's can't be excluded that redraw speed will be even slower at full scale for them. Caching of extents speeds things up about 1.5 times at all scales. So less analysis is needed here.

The analysis of start/stop editing shape speed is separate problem. We haven't done anything for it so far (apart from slowing between v4.6 and 4.7RC1). I don't see much sense in integral numbers of all operations as different factors/changes affects them and they hardly can be used for analysis.

Suggestion
So first I'd test the redraw rate the following way:

5-8 different scales * about 10-20 random places tested for each scale;
average redraw time and standart deviation for each scale;
Testing modes:
v4.6 Regular mode
v4.6 Edit mode
v4.7RC2 Regular mode
v4.7RC2 Regular mode + Spatial index
v4.7RC2 Edit mode
v4.7RC2 Edit mode + CacheExtents
v4.7RC2 Edit mode + QuadTree
v4.7RC2 Edit mode + CacheExtents + QuadTree

All results shouldn't include time on start/stop edit mode; shape selection; creating spatial index; generating qtree. Redraw with/without points can be included but it's rather secondary matter and better not to meddle with it.

Hope this will help.

By the way is it possible to make background of graph white or something like this? My eyes are really aching from red ;)

Regards,
Sergei



Edited 1 time(s). Last edit at 08/05/2009 05:48PM by Sergei.

Options: ReplyQuote
Re: [Performance-tests] New preliminary results for test run #3
Posted by: pmeems ()
Date: August 06, 2009 08:23AM

Here are some preliminary test result with the latest test script.
Bare in mind the test was run on my 1GB dev VM not on the usual 2GB test VMs.
I'll do that tonight.

Using v4.7.2Patch

I ran these tests in regular mode, so no StartEditingShapes was called:
* Without SpatialIndex, QTree or CacheExtents: 3min 24s
* With SpatialIndex,without QTree or CacheExtents: 3min 42s (mainly because of the creation of the spatial index: 1min)
* With SpatialIndex, QTree and CacheExtents: 3min 48s


These are the result when in edit mode:
* Without SpatialIndex, QTree or CacheExtents: approx. 35min (still running)
* With SpatialIndex,without QTree or CacheExtents: still to come
* With SpatialIndex, QTree and CacheExtents: still to come


Paul

--
Don't forget to read the new documentation: www.mapwindow.org/documentation/mapwingis4.8
Join us Google+: MapWindow GIS Google+ Community
Join the MapWindow Group on LinkedIn! LinkedIn - MapWindow Group

Download the latest beta installer at:
tinyurl.com/mwMonthly 32-Bit
tinyurl.com/mwMonthlyx64 64-Bit
Follow me on Twitter MapWindow_nl to read when a new installer is published.

---
Paul Meems
The Netherlands
[www.bontepaarden.nl]
Release manager, configuration manager and
forum moderator of MapWindow GIS

Owner of MapWindow.nl - Support for
Dutch speaking users: www.mapwindow.nl

*******
Everything I say or write is my personal opinion and
not the opinion of the company I work for.
*******
View my profile on LinkedIn

Options: ReplyQuote
Re: [Performance-tests] First results
Posted by: Sergei ()
Date: August 06, 2009 05:46PM

Hello, Paul

I made my own test as I described above.
I used shapefile with 55 443 polygons, the size of shp file is 19.9Mb.
Test PC: AMD Athlon 64 X2 Dual, 2.61GHz; 1.93Gb RAM; Windows XP SP2;
Version of ocx: my last local build.
Number of places and scales – those that are in code.

TEST PROCEDURE
Public Function PerformTest()
' a test of redraw speed for different cases
  Dim sf As MapWinGIS.ShapeFile

    Set sf = Layers(0).GetShapefile: If sf Is Nothing Then Exit Function
    
    Screen.MousePointer = vbHourglass
    frmMdi.Enabled = False
    On Error GoTo Error_Handler
      
      ' 1.
      If Not sf.HasSpatialIndex Then
        TestCase sf, "v4.7RC2 Regular mode"
      End If
      
      '2.
      sf.CreateSpatialIndex sf.FileName
      If sf.HasSpatialIndex Then
        TestCase sf, "v4.7RC2 Regular mode + Spatial index"
      End If
            
      If MShapefile.StartEditShapes(sf) Then
        '3.
        sf.CacheExtents = False
        sf.UseQTree = False
        If (Not sf.CacheExtents And Not sf.UseQTree) Then
          TestCase sf, "v4.7RC2 Edit mode"
        End If
        '4.
        sf.CacheExtents = True
        If (sf.CacheExtents And Not sf.UseQTree) Then
          TestCase sf, "v4.7RC2 Edit mode + CacheExtents"
        End If
        
        '5.
        sf.UseQTree = True
        If (sf.CacheExtents And sf.UseQTree) Then
          TestCase sf, "v4.7RC2 Edit mode + CacheExtents + QuadTree"
        End If
        
        '6.
        sf.CacheExtents = False
        If (Not sf.CacheExtents And sf.UseQTree) Then
          TestCase sf, "v4.7RC2 Edit mode + QuadTree"
        End If
      End If
      
Error_Handler:
  Screen.MousePointer = vbDefault
  frmMdi.Enabled = True
End Function

Public Function TestCase(sf As MapWinGIS.ShapeFile, sCaseName As String)
' measuring of redraw time on different scales
  
  Dim ext As MapWinGIS.Extents
  Dim extNew As New MapWinGIS.Extents
  Dim pnt As MapWinGIS.Point
  
  Dim XMinPixel As Double
  Dim YMinPixel As Double
  Dim XMaxPixel As Double
  Dim YMaxPixel As Double
  
  Dim Width As Double
  Dim Height As Double
  
  Dim x As Double
  Dim y As Double
  
  Dim aScales As Variant
  
  Dim iScale As Integer
  Dim i As Integer
  Dim j As Integer
    
  Dim dTime As Double
  Dim aResults() As Double
  Dim dAverage As Double
  Dim dStdDev As Double
  
  Dim aSequence() As Double
  Dim sBuffer As String
    
  Const RANDOM_SEED = 3.1415  ' any number
  Const NUM_PLACES = 10      ' number of random places for each scale
    
    Set ext = sf.Extents
    
    mAxMap.ZoomToLayer 0
    
    ' size of the map control in pixels
    mAxMap.ProjToPixel ext.xMax, ext.yMax, XMaxPixel, YMaxPixel
    mAxMap.ProjToPixel ext.xMin, ext.yMin, XMinPixel, YMinPixel
    
    aScales = Array(250000, 150000, 100000, 75000, 50000, 25000, 10000, 5000, 1000, 500)
        
    Debug.Print vbCr & UCase$(sCaseName)
        
    For i = LBound(aScales) To UBound(aScales)
      
      ' extents width and height in map units
      Width = (XMaxPixel - XMinPixel) / PixelsPerMeter * aScales(i)
      Height = (YMaxPixel - YMinPixel) / PixelsPerMeter * aScales(i)
      'PixelsPerMeter = 56700 / (Screen.TwipsPerPixelX + Screen.TwipsPerPixelY) * 2
      
      ReDim aResults(1 To NUM_PLACES)
      ReDim aSequence(1 To NUM_PLACES)
      
      Rnd -1
      Randomize RANDOM_SEED ' first number is the same for all cases;
                            ' the sequance after it must be identical also
      
      For j = 1 To NUM_PLACES   ' random places
        
        ' random position
        x = ext.xMin + (ext.xMax - ext.xMin) * Rnd
        y = ext.yMin + (ext.yMax - ext.yMin) * Rnd
        
        ' setting new extent
        extNew.SetBounds x - Width / 2, y - Height / 2, 0, x + Width / 2, y + Height / 2, 0
        
        dTime = Timer
        Set mAxMap.Extents = extNew: DoEvents
        
        aResults(j) = Timer - dTime
        aSequence(j) = x
      Next j
      
      dAverage = MMain.MeanValue(aResults)      ' my own functions
      dStdDev = MMain.RootMeanSquares(aResults)
      
      Debug.Print "Scale " & aScales(i) & "; Redraw time = " & Format(dAverage, "0.000") & _
                  "+-" & Format(dStdDev, "0.0000")
      sBuffer = ""
      For j = 1 To NUM_PLACES
        sBuffer = sBuffer & Format(aSequence(j), "0.000") & "; "
      Next j
'      Debug.Print "X Sequence: " & sBuffer   ' to test that sequence is the same
    Next i
    
End Function

RESULTS
V4.7RC2 REGULAR MODE
Scale 250000; Redraw time = 0.428+-0.0651
Scale 150000; Redraw time = 0.306+-0.0612
Scale 100000; Redraw time = 0.251+-0.0498
Scale 75000; Redraw time = 0.231+-0.0336
Scale 50000; Redraw time = 0.208+-0.0221
Scale 25000; Redraw time = 0.191+-0.0142
Scale 10000; Redraw time = 0.183+-0.0077
Scale 5000; Redraw time = 0.178+-0.0079
Scale 1000; Redraw time = 0.178+-0.0108
Scale 500; Redraw time = 0.180+-0.0109

V4.7RC2 REGULAR MODE + SPATIAL INDEX
Scale 250000; Redraw time = 0.411+-0.0950
Scale 150000; Redraw time = 0.230+-0.0931
Scale 100000; Redraw time = 0.147+-0.0696
Scale 75000; Redraw time = 0.114+-0.0582
Scale 50000; Redraw time = 0.084+-0.0332
Scale 25000; Redraw time = 0.058+-0.0164
Scale 10000; Redraw time = 0.047+-0.0103
Scale 5000; Redraw time = 0.045+-0.0089
Scale 1000; Redraw time = 0.047+-0.0128
Scale 500; Redraw time = 0.047+-0.0129

V4.7RC2 EDIT MODE
Scale 250000; Redraw time = 5.847+-0.2504
Scale 150000; Redraw time = 5.364+-0.2293
Scale 100000; Redraw time = 5.222+-0.1845
Scale 75000; Redraw time = 5.225+-0.1492
Scale 50000; Redraw time = 5.176+-0.1606
Scale 25000; Redraw time = 5.092+-0.1524
Scale 10000; Redraw time = 5.059+-0.1643
Scale 5000; Redraw time = 5.095+-0.1634
Scale 1000; Redraw time = 5.097+-0.1504
Scale 500; Redraw time = 5.076+-0.1422

V4.7RC2 EDIT MODE + CACHEEXTENTS
Scale 250000; Redraw time = 0.645+-0.1491
Scale 150000; Redraw time = 0.341+-0.1446
Scale 100000; Redraw time = 0.214+-0.1028
Scale 75000; Redraw time = 0.162+-0.0748
Scale 50000; Redraw time = 0.112+-0.0414
Scale 25000; Redraw time = 0.073+-0.0166
Scale 10000; Redraw time = 0.058+-0.0104
Scale 5000; Redraw time = 0.055+-0.0083
Scale 1000; Redraw time = 0.055+-0.0081
Scale 500; Redraw time = 0.056+-0.0108

V4.7RC2 EDIT MODE + CACHEEXTENTS + QUADTREE
Scale 250000; Redraw time = 0.689+-0.1793
Scale 150000; Redraw time = 0.330+-0.1603
Scale 100000; Redraw time = 0.181+-0.1143
Scale 75000; Redraw time = 0.122+-0.0801
Scale 50000; Redraw time = 0.072+-0.0472
Scale 25000; Redraw time = 0.028+-0.0205
Scale 10000; Redraw time = 0.012+-0.0098
Scale 5000; Redraw time = 0.009+-0.0080
Scale 1000; Redraw time = 0.011+-0.0105
Scale 500; Redraw time = 0.011+-0.0128

V4.7RC2 EDIT MODE + QUADTREE
Scale 250000; Redraw time = 5.086+-0.3666
Scale 150000; Redraw time = 4.422+-0.3613
Scale 100000; Redraw time = 4.122+-0.2079
Scale 75000; Redraw time = 4.000+-0.2371
Scale 50000; Redraw time = 3.937+-0.1848
Scale 25000; Redraw time = 3.836+-0.1594
Scale 10000; Redraw time = 3.802+-0.1221
Scale 5000; Redraw time = 3.780+-0.1362
Scale 1000; Redraw time = 3.780+-0.1428
Scale 500; Redraw time = 3.789+-0.1572

Analysis and graph is for tomorrow.

Regards,
Sergei

Options: ReplyQuote
Re: [Performance-tests] New preliminary results for test run #3
Posted by: pmeems ()
Date: August 07, 2009 04:56AM

Sergei,

I've altered my script so it will now only do a zoom to a shape and then the zoom to scale.
I zoom to a specific coordinate because else I could potentially zoom to a very white area which will blur the results.
I use some more scales because my shapefile is much larger.
In regular mode I can see an speed improvement when using SpatialIndex, so that's good.
I'm now in edit mode and it is very, very slow. I'm talking tens of minutes.
Would you mind testing your script with the same shapefile I'm using?

And can I use your shapefile? Just to exclude differences in used data and used script. You could also just run my script with your shapefile.

The next days I'll publish the test results of my test machines.

Paul.

--
Don't forget to read the new documentation: www.mapwindow.org/documentation/mapwingis4.8
Join us Google+: MapWindow GIS Google+ Community
Join the MapWindow Group on LinkedIn! LinkedIn - MapWindow Group

Download the latest beta installer at:
tinyurl.com/mwMonthly 32-Bit
tinyurl.com/mwMonthlyx64 64-Bit
Follow me on Twitter MapWindow_nl to read when a new installer is published.

---
Paul Meems
The Netherlands
[www.bontepaarden.nl]
Release manager, configuration manager and
forum moderator of MapWindow GIS

Owner of MapWindow.nl - Support for
Dutch speaking users: www.mapwindow.nl

*******
Everything I say or write is my personal opinion and
not the opinion of the company I work for.
*******
View my profile on LinkedIn

Options: ReplyQuote
Re: [Performance-tests] First results
Posted by: pmeems ()
Date: August 09, 2009 02:19PM

Did the tests again.
This time with the data set provided by Sergei (33MB) and my own (215MB). And the smaller test runs.

Some significant results came up (see attachment).
The first one is the speed difference with v4.6. In almost all situations v4.6 is much faster.
Using Quadtree or not doesn't influence the speed. Using Cache extents does, a lot.
Only when Cache Extents is enabled, v4.7 is faster than v4.6!
Some results (total time used_, first the medium data set, then the huge data set
v4.6 Edit:          4min 41s   21min 32s
v4.7 Edit:         13min 27s   54min 15s
v4.7 CacheExtents:  2min 10s    9min 57s
v4.7 Quadtree:     13min 31s   55min 57s
I don't see any problems with Cache Extents so I want to recommend to make it enabled by default.

Perhaps my tests aren't using the QuadTree capabilities but for now I don't see why to enable it. It isn't improving anything.

I've also tested using Spatial Index. My results show a minor speed improvement when enabling it. To start all my test with the same settings I deleted the created index files after every run. So when Spatial Index was enabled it had to create those files every time. That made the difference between not using the index very small. But in a real life situation you wouldn't do that so the improvement, specially for larger files, is significant.
I would recommend to enable Spatial Index by default as well.
Here are some results. I've corrected the total time by subtracting the time needed to create the index files:
v4.6 Regular:        42s   1min 52s
v4.7 Regular:        49s   1min 58s
v4.7 Spatial Index:  54s   0min 55s

Thanks,

Paul

--
Don't forget to read the new documentation: www.mapwindow.org/documentation/mapwingis4.8
Join us Google+: MapWindow GIS Google+ Community
Join the MapWindow Group on LinkedIn! LinkedIn - MapWindow Group

Download the latest beta installer at:
tinyurl.com/mwMonthly 32-Bit
tinyurl.com/mwMonthlyx64 64-Bit
Follow me on Twitter MapWindow_nl to read when a new installer is published.

---
Paul Meems
The Netherlands
[www.bontepaarden.nl]
Release manager, configuration manager and
forum moderator of MapWindow GIS

Owner of MapWindow.nl - Support for
Dutch speaking users: www.mapwindow.nl

*******
Everything I say or write is my personal opinion and
not the opinion of the company I work for.
*******
View my profile on LinkedIn

Attachments: Quadtree-performance-smalltest.zip (73.1 KB)  
Options: ReplyQuote
Re: [Performance-tests] First results
Posted by: neio ()
Date: August 09, 2009 09:18PM

Hello, Sergei,

I have been so busy with my work these days and sorry to reply so late.

You have tested in the round, it's a great work. I think it is so persuasive.


Hello, Paul

QuadTree is a spatial index mechanism, designed to improve the speed for query data in small area, without reading all data. If the test area is the whole map, there would definitely NO improvement.

I saw that in Sergei's test, in small scales, the Quadtree+CacheExtents has a best performance overall.

Best Regards,

Neio Zhou (ZHOU Conghui)
周聪辉
--------------------------------

Currently Master Candidate in Computer Science, The Chinese University of Hong Kong
现在为香港中文大学计算机科学硕士研究生

Quanzhou STrong Newtork Co. Ltd. , China from March 2009 to August 2010
2009年至2010年供职于中国泉州市视通光电网络有限公司

Options: ReplyQuote
Re: [Performance-tests] First results
Posted by: Sergei ()
Date: August 12, 2009 10:40AM

Hello,

About making new option the default ones:
- CacheExtents - works all right until an editing of shapes take place. After it without calling RefreshExtents, RefreshShapeExtents from client program shape extents will be incorrect with a number of unpleasant consequences. Maybe it will do no harm for MapWindow (shapefiles are displayed in regular mode only in shape editor) but certainly give problems for applications which perform editing and display shapefile in edit mode. I would not set this option to true by default.
- SpatialIndex - maybe I'm the only person who uses MapWinGis and cyrillic letters in the names of shapefiles, but spatial index doesn't support such names.
- Quad tree - performs very well on small scales. In general I think it's good idea to extend it on regular mode as it significantly outperforms spatial index. But I don't see reason to set it as a default for now.

In relation to decrease of speed between 4.6 and 4.7 versions:
we should review project build options (see [www.mapwindow.org]). With better tuned parameters difference between 4.6 and 4.7 ocx would be smaller.

Regards,
Sergei

Options: ReplyQuote
Re: [Performance-tests] First results
Posted by: pmeems ()
Date: August 16, 2009 01:43PM

Sergei, Neio,

A new release candidate has been posted (RC3). It was build with Sergei's suggested build parameters. I'll run the test script with that build later this week.

I understand how to use CacheExtents, SpatialIndex and QuadTree when working with the ocx and with the shapefiles directly.
But how do I benefit from these new features when working with the main application?
When I add a shapefile as a layer and it has a spatial index will it be used instantly or do I have to do something. We could add an option the the application settings in MapWindow to Yes or No create spatial indexes if not available.

But how about CacheExtents and QuadTree. How do I enable them and update them? When do I need to call RefreshExtents, RefreshShapeExtents? I could make a plug-in for this. The same for QuadTree. How to use it with MapWindow?

Thanks,

Paul

--
Don't forget to read the new documentation: www.mapwindow.org/documentation/mapwingis4.8
Join us Google+: MapWindow GIS Google+ Community
Join the MapWindow Group on LinkedIn! LinkedIn - MapWindow Group

Download the latest beta installer at:
tinyurl.com/mwMonthly 32-Bit
tinyurl.com/mwMonthlyx64 64-Bit
Follow me on Twitter MapWindow_nl to read when a new installer is published.

---
Paul Meems
The Netherlands
[www.bontepaarden.nl]
Release manager, configuration manager and
forum moderator of MapWindow GIS

Owner of MapWindow.nl - Support for
Dutch speaking users: www.mapwindow.nl

*******
Everything I say or write is my personal opinion and
not the opinion of the company I work for.
*******
View my profile on LinkedIn

Options: ReplyQuote
Re: [Performance-tests] First results
Posted by: Sergei ()
Date: August 17, 2009 12:25PM

Paul,

I don't think that MapWindow in present form can benefit from CacheExtents. Shape editor opens and closes edit mode for each change so no redraw in edit mode occurs. Maybe some plug-ins redraw shapefile in edit mode? For them maybe it'd be good.
The situation with quad tree is more or less the same. Neio can say more.
To gain from these changes edit sessions are needed. As long as know it's very problematic to edit large shapefiles in MapWindow, edit sessions + CacheExtents + QTree can solve it.

Regards,
Sergei

Options: ReplyQuote


Sorry, only registered users may post in this forum.





Banner Exchange




GISCP.com




Send us your banner logo (160x120) for the space above, and add this MapWindow banner ad to your site:

Just paste this text in your page: