Page 2 of 4

Re: Grid performance terribly slow on a file share, browse works well

Posted: Wed Oct 04, 2017 8:34 pm
by mol
I'm using netio server to get data from .dbf files, because windows sharing does not work well (terrible very slow).
Netio solution is great!

Re: Grid performance terribly slow on a file share, browse works well

Posted: Wed Feb 07, 2018 7:04 pm
by franco
I am using a browse to look up inventory items for my grid. I have a textbox to type into to update the browse.
windows sharing.
This works well on a workstation if server is not in use, but is really to slow when server starts to do anything.
In this dbf table there are 150,000 items and I use a ntx index. This is almost unusable.... Any thoughts,
Franco

Re: Grid performance terribly slow on a file share, browse works well

Posted: Wed Feb 07, 2018 7:22 pm
by trmpluym
Hi Franco,

I also struggled with this performance problem. Here how i solved the problem:

1. The Browse control is much faster than the Grid control
2. Use LetoDB ( http://www.kresin.ru/en/letodb.html ) this works fantastic !

Theo

Re: Grid performance terribly slow on a file share, browse works well

Posted: Wed Feb 07, 2018 7:34 pm
by mol
I've changed my applications to work with NETIO server.
After few modifications inside Windows, samba protocol causes a lot of performance problems.

Re: Grid performance terribly slow on a file share, browse works well

Posted: Wed Feb 07, 2018 8:03 pm
by trmpluym
Hi Marek,

I also first tried NETIO but LetoDB is much, much faster.

You should try it. And (like NETIO) the required source modifications are minimal.

Theo

Re: Grid performance terribly slow on a file share, browse works well

Posted: Wed Feb 07, 2018 10:00 pm
by franco
Theo, I am lost when adding things like this. Can you help me. Ido not know where to start.
Thanks, Franco

Re: Grid performance terribly slow on a file share, browse works well

Posted: Sat Feb 10, 2018 6:48 pm
by franco
Here is a small sample of my problem. When there are 1000 items not to much problem but when large table big problem.
If you compile this and run on one computer it runs good, but if you map a network drive from another computer to computer
where program is and is already running in the grid it is really unusable.

******* PROBLEM RESOLVED WITH FOLLOWING REVISED CODE *****

Code: Select all

#include <hmg.ch>

Function Main
OPNFLS()
	DEFINE WINDOW Form_1 ;
		AT 0,0 ;
		WIDTH 1000 ;
		HEIGHT 610 ;
		TITLE 'Browse Test' ;
		MAIN 
		
		@10,10 BUTTON Button_1 CAPTION 'Browse' WIDTH 75 HEIGHT 75 MULTILINE ;
		         NOTABSTOP TOOLTIP 'Browse Inv' ;
				 ACTION { || BRWCRS(87, 228, 220, 100, 390, 'ITEM', 'OH ', "INV", 'NUM1', 'NUM2') }

		
			END WINDOW

	CENTER WINDOW Form_1

	ACTIVATE WINDOW Form_1

Return
////////////////////// This I put in its own program and can use from any other procedure by 
////////////////////// Opening the files set the indexes and send the above parameters

function brwcrs

LOCAL WID1, OSEL
PRIVATE NORD := INDEXORD()            /// TO RESET THE INDEXES ON RETURN
PARAMETERS R1, C1, W1, W2, H1, H2, H3, T1, FC1, FC2      // TA, W1, W2, C1, R1, H1, I1, D1, FC1, FC2
// R1 = ROW.... C1 = COLUMN.... W1 = WIDTH OD FIRST FIELD.... W2 = WIDTH OF SECOND FIELD
// H1 = HEIGHT.... H2 = HEADER 1.... H3 = HEADER 2.... T1 = TABLE.... FC1 = FIELD1.... FC2 = FIELD 2
///////////////////// REVISED
IF RECCOUNT() > 1000          //THIS IS FOR WHEN USING BROWSE FOR MORE THAN ONE PROGRAM.. 1000 SEEMS TO SLOW TERMINAL
	 CREATEFOLDER("C:\TEMP")
	INDEX ON NUM1 TO C:\TEMP\BRSINV      // THIS WORKS 1.5 SECOND TO CREATE INDEX ON 800000 RECORDS
ENDIF
//////////////////////////////////////// I HAVE TRIED UP TO 800000 RECORDS VERY FAST

IF W2 = 0
   WID1 := 'FC1'
ELSE 
   WID1 := 'FC1 , FC2'
ENDIF  
DEFINE WINDOW frmQSMain ;
AT  R1+80, C1+10 ;
WIDTH W1+W2+40 ;      //GetDesktopWidth() * 0.75 ;
HEIGHT H1+20 ;  // GetDesktopHeight() * 0.75 ;
WINDOWTYPE CHILD ;
TITLEBAR .F. 

  ON KEY ESCAPE ACTION { || MKEY := .T., Goo6() }                 //frmQSMain.Release}


DEFINE BROWSE brwItems
ROW 0     //133
COL 0     //211
WIDTH W1 + W2+25  // 400
HEIGHT H1  //290
BACKCOLOR    { 255, 255, 255}
FONTCOLOR { 0, 0, 0 }
HEADERS  {H2 , H3}
WIDTHS   {W1, W2}
WORKAREA  &T1 //inv
FIELDS { &WID1}
ONDBLCLICK { || dbgoto(this.value), Goo6()    }            //frmQSMain.Release  }
ONLOSTFOCUS { || dbgoto(this.value),Goo6()  }           // frmQSMain.Release } 
ONCHANGE { || dbgoto(this.value) }
TOOLTIP 'Press Escape to Exit'
NOLINES .F.
END BROWSE // brwItems

DEFINE TEXTBOX textSearch
ROW 1 //R1
COL 1  //232
WIDTH 1 // 200 can make 1 so you cannot see
HEIGHT 24
ONCHANGE { || DBSEEK( UPPER( this.Value ), .T. ), frmQSMain.brwItems.value := &T1->(RECNO() ) }
ONENTER { || frmQSMain.brwItems.SETFOCUS }
ONLOSTFOCUS { || frmQSMain.brwItems.SETFOCUS}
END TEXTBOX // tbxSearch
END WINDOW // frmQSMain  

frmQSMain.textSEARCH.SETFOCUS
frmQSMain.Activate
return
////////////////////////////////// End of browse program 

FUNCTION OPNFLS
LOCAL CF
if ! file('inv.dbf')
	CF := {}
	aADD(CF,{'NUM1'       ,'C' , 15,0})
	aADD(CF,{'NUM2'       ,'C' , 15,0})

	DBCREATE( 'INV.DBF',CF )
	USE
   
   USE INV EXCLUSIVE NEW 
	INDEX ON NUM1 TO NUM1
	DO WHILE RECNO()< 100000
	INV->( DBAPPEND())
	INV->( FIELDPUT(1, 'P'+ALLTRIM(STR(20+RECNO())) ))
	INV->( FIELDPUT(2, 'PARTS' ))

	LOOP
	ENDDO
	USE
ENDIF

SELECT 1
USE INV SHARED
SET INDEX TO NUM1

RETURN

FUNCTION GOO6
LOCAL OLDREC := RECNO()
SET ORDER TO NORD
DBGOTO(OLDREC)
frmQSMain.Release
RETURN

This is what I am now using.
Thanks Franco ;)

Re: Grid performance terribly slow on a file share, browse works well

Posted: Sat Feb 10, 2018 9:17 pm
by serge_girard
Franco,

Suggestion: (I didn't try out , yet) create index on local.

Maybe this helps

Serge

Re: Grid performance terribly slow on a file share, browse works well

Posted: Sat Feb 10, 2018 9:56 pm
by franco
Hi Serge,
Can we create a index into local memory, then when finished and closing tables, release the index.
I map network drive, then go to drive and send the exe to desktop. so tables are in main drive but program in this computer, so when going into invoicing program I would have to create a local index on all local computers.
I am running in (say z: drive) and index in c: drive or local memory.
I wonder if create a temp file does it go into memory. if so I can create a temp index for that file , then select my inventory file and index it to the temp index. ?? might work.
Thanks Franco

Re: Grid performance terribly slow on a file share, browse works well

Posted: Sat Feb 10, 2018 10:15 pm
by serge_girard
Right! Just try it! And let me know.

Serge