Author | Topic: M$ MapPoint and Xbase++ activeX | |
---|---|---|
AUGE_OHR | M$ MapPoint and Xbase++ activeX on Fri, 21 Aug 2009 04:25:54 +0200 hi, i ask in Mapoint Forum to "speed-up" setting PushPin and got a Answer ************************************************************************************** my old Code use FindAdressResult() and it take a long time to set 3000 Pushpin. now i try to use GPS Koodinate, but oLocation := ::oMap:ActiveMap:GetLocation(x,y,100) is not faster than my old Code ? any Tips how to set 3000 Pushpin "faster" ? ************************************************************************************** Both calls, FindAddressResult and GetLocation and setting the associated pushpin involve "out-of-process" invocation and data marshaling to and from MapPoint. The actual work done (time spent) by MapPoint executing both calls is a small fraction of the actual overhead for invocation and data marshaling. Thus, the speed will be similar. IMO, you the delay for each pushpin placement is something that you have to live with. It is slow. Dick Richard Grier (Microsoft MVP - Visual Basic) Hard & Software 12962 West Louisiana Avenue Lakewood, CO 80228 303-986-2179 (voice) Homepage: www.hardandsoftware.net Author of Visual Basic Programmer's Guide to Serial Communications, 4th Edition ISBN 1-890422-28-2 (391 pages) published July 2004, Revised July 2006. ************************************************************************************** i do understand that activeX have a Overhead, but if i need > 2,5 hour to set 3000 Pushpin (P4, 3Ghz, 2GB, 7200rpm,ATi9600XT) and show new Position on Map every 3-4sec ... what happend within activeX for 2 sec ? it is like i try to fill a Excel Spreedsheet "Cell by Cell" with each Item, but i know to use :Range():value := aExcel so i can use a Array fill hole :Range():value in a one Second. so i ask if there any "tricks", like a 2-dim Array, and than pass hole Array? ************************************************************************************** any Idee how to "speed-up" Xbase++ activeX / Mappoint to "reduce Overhead" ? greetings by OHR Jimmy | |
Thomas Braun | Re: M$ MapPoint and Xbase++ activeX on Fri, 21 Aug 2009 10:21:25 +0200 AUGE_OHR wrote: > > IMO, you the delay for each pushpin placement is something that you have to > live with. It is slow. lol - so the basic message should be "ActiveX is crap"? thomas | |
AUGE_OHR | Re: M$ MapPoint and Xbase++ activeX on Fri, 21 Aug 2009 18:55:09 +0200 hi, >> IMO, you the delay for each pushpin placement is something that you have >> to >> live with. It is slow. > > lol - so the basic message should be "ActiveX is crap"? i got a other Msg ******************************************************************************************** Hi Jimmy, I just did a test on a slower machine than yours. Putting 500 pushpins on a map take here 36 seconds. So 3000 should take around 4 minutes. If you do a win32 call to LockWindowsUpdate then the 500 pushpins take 10 seconds here. So you have to examine your application to find out what it do during the 2.5 hour! Since this is a very huge time you can eventually already see what takes long if stepping with the debugger in it. It must be something that takes almost 3 seconds! (of course it can be multiple things together but you will find out soon) rgds, Wilfried Microsoft MapPoint MVP ******************************************************************************************** it it not activeX itself ... it is "something" inside Xbase++ activeX which make the Difference. i did not test it with Jazzage or YUKON, but 4min vs. 2 1/2Std ... hm ... what can Wilfired "meen2 with "do a win32 call to LockWindowsUpdate" ? greetings by OHR Jimmy | |
AUGE_OHR | Re: M$ MapPoint and Xbase++ activeX on Sun, 23 Aug 2009 21:55:12 +0200 hi, > lol - so the basic message should be "ActiveX is crap"? after i was told "how fast" activeX can be i have done some more work DBF 225 Records a.) strip down Xbase++ Code to "minimum" using FindAddressResults() and just use 1st Item oLocation := oResult:Item(1) nComplet : 90.21 per Rec : 0.40 nSumFind : 0.14 -> FindAddressResults() nSumGoto : 0.02 -> Goto(oLocation) nSumAdd : 0.18 -> AddPushPin() these 3 activeX call use 0.34sec, all other is Xbase++ (here 0.06) this is much, much better ... but still far away from "what is possible" b.) while i use Xbase (here without ++) i can use same Source Code with "other" Compiler nComplet : 22.95 per Rec : 0.10 nSumFind : 0.04 nSumGoto : 0.01 nSumAdd : 0.04 and here my Code *** start *** PROCEDURE ShowMap(oWnd,oStatic) LOCAL cLicCalendar := "Mappoint Control 9.0 Runtime License" LOCAL cVer := "11" LOCAL nMode := 1 LOCAL ClsCalendar := "{8F78D7FC-BAE4-46A4-A79A-052356AB3DD4}" *LOCAL ClsCalendar := "MapPoint.Control" +"."+ cVerCalendar LOCAL oMapDlg LOCAL aSize := oStatic:currentsize() * oMapDlg := WvgActiveXControl():New( oWnd , , {0,0}, aSize, , .t. ) oMapDlg := WvgActiveXControl():New( oStatic, , {0,0}, aSize, , .t. ) oMapDlg:CLSID := ClsCalendar oMapDlg:license := cLicCalendar oMapDlg:Cargo := "Mappoint" oMapDlg:create() oMapDlg:BorderStyle := 1 has border oMapDlg:Appearance := 1 border is 3D oMapDlg:NewMap( geoMapEurope ) oMapDlg:Units := geoKm #IFDEF __XPP__ #ELSE * oWnd:sendMessage( WM_SIZE, 0, 0 ) * oWnd:Hide() #ENDIF oWnd:Show() China2Loc(oMapDlg) RETURN PROCEDURE China2Loc(oMap) LOCAL cText LOCAL cTelNo LOCAL nCount := 0 LOCAL oLocation LOCAL aLoc := {} LOCAL aSize := {400,300} LOCAL aPos LOCAL oPushPin := NIL LOCAL nProz LOCAL cProz LOCAL nLen LOCAL oResult LOCAL cNeuNo LOCAL nStart LOCAL nStop LOCAL nSumFind := 0 LOCAL nSumAdd := 0 LOCAL nSumGoto := 0 LOCAL nComplet := 0 LOCAL nDiff LOCAL imax SET ALTER TO HbAsiaMap.TXT SET ALTER ON oMap:Show() oMap:ActiveMap:ActiveRoute:Clear() SELECT 1 USE (zPATH+"ASIA06.DBF") EXCLUSIVE nLen := LASTREC() GO TOP nComplet := SECONDS() DO WHILE !EOF() SELECT 1 cTelNo := " 0"+ALLTRIM(ASIA06->VORWAHL)+"/"+ALLTRIM(ASIA06->TELEFON) cText := TRIM(ASIA06->NAME)+CRLF+; TRIM(ASIA06->STRASSE)+CRLF+; ASIA06->PLZ+" "+ASIA06->ORT cNeuNo := "B"+STRZERO(RECNO(),4) REPLACE ASIA06->NeuNr WITH cNeuNo nStart := SECONDS() oResult := oMap:ActiveMap:FindAddressResults( ; TRIM(ConvToOEMCP(ASIA06->Strasse)),; TRIM(ConvToOEMCP(ASIA06->Ort )),; NIL,; NIL,; TRIM(ConvToOEMCP(ASIA06->PLZ )),; geoCountryGermany ) nStop := SECONDS() ? nDiff := (nStop-nStart) nSumFind := nSumFind +nDiff ? imax := oResult:Count() oLocation := oResult:Item(1) just use 1st Item nStart := SECONDS() oLocation:goto() nStop := SECONDS() ? nDiff := (nStop-nStart) nSumGoto := nSumGoto +nDiff nStart := SECONDS() oPushPin := oMap:ActiveMap:AddPushpin(oLocation,ASIA06->NeuNr ) oPushPin:Symbol := 86 oPushPin:Note := cTelNo+CRLF+cText AADD(aLoc,oLocation) nStop := SECONDS() ? nDiff := (nStop-nStart) nSumAdd := nSumAdd +nDiff ? "" SELECT 1 nCount++ SKIP * IF nCount > 10 EXIT ENDIF ENDDO IF LEN(aLoc) > 0 oMap:ActiveMap:Union(aLoc):goto() ENDIF oMap:SaveMapAs("HbAsiaMap") ? "***************" ? "" ? "nComplet :"+STR( SECONDS()-nComplet ,10,2) ? "per Rec :"+STR((SECONDS()-nComplet)/nCount,10,2) ? "" ? "nSumFind :"+STR( nSumFind / nCount,10,2) ? "nSumGoto :"+STR( nSumGoto / nCount,10,2) ? "nSumAdd :"+STR( nSumAdd / nCount,10,2) ? "" SET ALTER OFF SET ALTER TO RETURN *** eof *** while both are activeX call i wonder about so much Difference in Time ? greetings by OHR Jimmy |