TSBrowse and network (again)

TSBrowse and network (again)

Postby Kleyber » Thu Jul 31, 2008 11:46 am

Hi All,

I know this issue was discussed before, but about TXBrowse using medium or large dbfs over a lan, but I`m facing a trouble with TSbrowse, but in a wireless lan. When my app tries to open a small-to-medium dbf in a LAN with cables, it opens normally, but here we have now a complete wireless lan and I noticed a very very slow traffic. It makes a dbf (in this app) to browse the records in almost 2 minutes... (and the dbf has just 2600 records). I use TSBrowse because of all the features it has and specially in this app I use cell edition, searching, and many other things. I know that TWBrowse is the fastest browse, but it does not have all the features I need and I found in TSbrowse. What do you say about it? What are your opinions?

Regards,
Kleyber Derick

FWH / xHb / xDevStudio / SQLLIB
User avatar
Kleyber
 
Posts: 581
Joined: Tue Oct 11, 2005 11:28 am
Location: São Luiz, Brasil

Postby James Bott » Thu Jul 31, 2008 1:53 pm

Kleyber,

I don't think this is a browse issue. Are you filtering the database using SET FILTER?

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: TSBrowse and network (again)

Postby mmercado » Thu Jul 31, 2008 2:12 pm

Kleyber wrote:I know this issue was discussed before, but about TXBrowse using medium or large dbfs over a lan, but I`m facing a trouble with TSbrowse, but in a wireless lan. When my app tries to open a small-to-medium dbf in a LAN with cables, it opens normally, but here we have now a complete wireless lan and I noticed a very very slow traffic. It makes a dbf (in this app) to browse the records in almost 2 minutes... (and the dbf has just 2600 records). I use TSBrowse because of all the features it has and specially in this app I use cell edition, searching, and many other things. I know that TWBrowse is the fastest browse, but it does not have all the features I need and I found in TSbrowse. What do you say about it? What are your opinions?
Hi Kleyber:

You should check the access point conections, in a normal wireless speed (54 mbps) the performance should be more or less 50 % against a 100 mbps lan.

I'm working right now in a remote wireless conection and I'm browsing a 226000 records dbf with a reasonably comfortable speed.

Please give me your email to send you a program for testing.

Regards.

Manuel Mercado.
User avatar
mmercado
 
Posts: 782
Joined: Wed Dec 19, 2007 7:50 am
Location: Salamanca, Gto., México

Postby Kleyber » Thu Jul 31, 2008 6:24 pm

James,
I don't think this is a browse issue. Are you filtering the database using SET FILTER?

No, in fact I never use SET FILTER. In this case, I open 7 dbfs and their indexes and I open the browse with just one of them. Remember that I `m using the version 6.13 modified by you. (A GREAT work!)

Manuel,
You should check the access point conections, in a normal wireless speed (54 mbps) the performance should be more or less 50 % against a 100 mbps lan.

I'm working right now in a remote wireless conection and I'm browsing a 226000 records dbf with a reasonably comfortable speed.

Please give me your email to send you a program for testing.


You are right. That was the first aspect I was considering. The speed decreases to a 50% in a wireless lan, but I am anxious for your test. You can email me at kleyber.ribeiro@grupoferraz.com.br

Best Regards,
Kleyber Derick

FWH / xHb / xDevStudio / SQLLIB
User avatar
Kleyber
 
Posts: 581
Joined: Tue Oct 11, 2005 11:28 am
Location: São Luiz, Brasil

Files on network

Postby TimStone » Fri Aug 01, 2008 3:53 pm

Kleyber,

I use the same TSBrowse ... and James and I have discussed speed quite a lot.

I have no problem with speed issues when using Advantage Database Server. However, in LOCAL SERVER mode, it can be slow.

I have place where this is very apparent. I open 6 databases, but that means I'm also opening CDX and FPT files, so that is about 15 files total. I do filter 5 of those also, so that will slow things down quite a bit.

When you think about it, that is a lot of data to move across the network since the processing takes place locally. It was faster with xbrowse but I also like the additional features in TSBrowse.

My clients had to invest in ADS ... which actually makes me happy because it makes for less chance of errors.

Tim
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Postby Kleyber » Fri Aug 01, 2008 9:08 pm

Tim and all,

I have no way to use ADS, but I`ve discovered some things were generating an additional slowness in the app.. In the beginning it has a DbEval() in order to show the result in the footers, which logically in a lan or a wireless lan put the app slow before the browse appears. After quiting it, it becomes faster, but not too much. I`ve tried the app from Manuel Mercado and it runs fast... very nice. Maybe I have to try the new tsbrowse version to see how it works.

Thanks a lot
Kleyber Derick

FWH / xHb / xDevStudio / SQLLIB
User avatar
Kleyber
 
Posts: 581
Joined: Tue Oct 11, 2005 11:28 am
Location: São Luiz, Brasil

Postby James Bott » Fri Aug 01, 2008 11:09 pm

Kleyber,

Yikes, do you mean you are doing a dbeval() on the entire 200,000 record database?

Are you calling it each time the seek is done also?

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby Kleyber » Fri Aug 01, 2008 11:55 pm

James,

The dbf has 2500 records, but even with so little records was very slow. After quitting it, it`s in a comfortable spped.

Regards,
Kleyber Derick

FWH / xHb / xDevStudio / SQLLIB
User avatar
Kleyber
 
Posts: 581
Joined: Tue Oct 11, 2005 11:28 am
Location: São Luiz, Brasil

Postby James Bott » Sat Aug 02, 2008 12:57 am

Kleyber,

The dbf has 2500 records, but even with so little records was very slow.


As expected. DBEval() is sending the entire 2500 records across the network. You should consider only showing the totals on-demand rather than by default. Perhaps users don't need to see them all the time.

Also, I still think there is something else in your code causing the slow browse refresh. Can we see the code where the problem is?

Have you tried creating a small (as simple as possible) sample program to see if you can recreate the problem?

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby Kleyber » Sat Aug 02, 2008 10:04 pm

James,

Also, I still think there is something else in your code causing the slow browse refresh. Can we see the code where the problem is?


Sure! Here it is:

Code: Select all  Expand view
*****************************************************************************
Function CadDup()
// Lançamentos no Contas a Pagar
*****************************************************************************
local oDlgAna, oBrw, nTotal:=0, nTotalPago:=0, nOpc:=1 //, dData1:=ctod(space(8)), dData2:=ctod(space(8))
private dData1:=ctod(space(8)), dData2:=ctod(space(8))

use tabfil alias FIL index tabfil shared new
use tabcpi alias CPI index tabcpi shared new
use tabpco alias PCO index tabpco shared new
use tabpsb alias PSB index tabpsb shared new
use tabban alias BAN index tabban shared new
use tabcai alias CAI index tabcai shared new
use tabved alias VED index tabved shared new

DEFINE DIALOG oDlgAna RESOURCE "CONTAS"

REDEFINE BITMAP RESOURCE "BARRA" ID 60 OF oDlgAna

sele CPI
set order to 8
set relation to loja into FIL
DbGoBottom()

REDEFINE RADIO oOpc VAR nOpc ID 64,65 OF oDlgAna UPDATE
REDEFINE VGET oData1 VAR dData1 ID 66 OF oDlgAna UPDATE CALENDARIO WHEN nOpc = 2
REDEFINE VGET oData2 VAR dData2 ID 67 OF oDlgAna UPDATE CALENDARIO WHEN nOpc = 2
REDEFINE BUTTON oBmpGer ID 70 OF oDlgAna PROMPT "&Gerar" ACTION (Verifica_Opcao(@nOpc,@dData1,@dData2,oBrw,@nTotal,@nTotalPago),oBrw:SetFocus(),oBrw:UpStable(),oBrw:Refresh())

REDEFINE BROWSE oBrw ALIAS "CPI" CELLED ID 61 OF oDlgAna

      ADD COLUMN TO oBrw TITLE "C.Custo" ;
          DATA FieldWBlock( "ccusto", Select( "CPI" ) ) ;
          SIZE 55 ;
          VALID { |uVar| Busca_Codigo( uVar, oBrw ) } ;
          POSTEDIT { || Pesquisa_Codigo()  } ;
          ALIGN DT_LEFT ;
          EDITABLE MOVE DT_MOVE_NEXT
      ADD COLUMN TO oBrw TITLE "Filial" ;
          DATA FieldWBlock( "loja", Select( "CPI" ) ) ;
          SIZE 55 ;
          VALID { |uVar| Busca_Fil( uVar, oBrw ) } ;
          ALIGN DT_LEFT ;
          EDITABLE MOVE DT_MOVE_NEXT
      ADD COLUMN TO oBrw TITLE "No. Título" ;
          DATA FieldWBlock( "dupli", Select( "CPI" ) ) ;
          SIZE 79 ;
          ALIGN DT_LEFT ;
          EDITABLE MOVE DT_MOVE_NEXT
      ADD COLUMN TO oBrw TITLE "Histórico" ;
          DATA FieldWBlock( "historico", Select( "CPI" ) ) ;
          SIZE 240 ;
          ALIGN DT_LEFT ;
          EDITABLE MOVE DT_MOVE_NEXT
      ADD COLUMN TO oBrw TITLE "Vencimento" ;
          DATA FieldWBlock( "venc", Select( "CPI" ) ) ;
          SIZE 77 ;
          ALIGN DT_CENTER ;
          EDITABLE MOVE DT_MOVE_NEXT
      ADD COLUMN TO oBrw TITLE "Valor" ;
          DATA FieldWBlock( "valor", Select( "CPI" ) ) ;
          SIZE 95 ;
          PICTURE "@E 999,999.99" ;
          POSTEDIT { || SomaTotal(@nTotal,@nTotalPago,oBrw)  } ;
          ALIGN DT_RIGHT ;
          EDITABLE MOVE DT_MOVE_NEXT
      ADD COLUMN TO oBrw TITLE "Dt.Pagto" ;
          DATA CPI->dpag ;
          SIZE 77 ;
          ALIGN DT_CENTER
      ADD COLUMN TO oBrw TITLE "Vl. Pago" ;
          DATA CPI->pago ;
          SIZE 95 ;
          PICTURE "@E 999,999.99" ;
          ALIGN DT_RIGHT
      ADD COLUMN TO oBrw TITLE "Cód. Vend" ;
          DATA FieldWBlock( "codven", Select( "CPI" ) ) ;
          SIZE 79 ;
          ALIGN DT_LEFT ;
          EDITABLE MOVE DT_MOVE_NEXT

   oBrw:lMChange:=.f.
   oBrw:SetColor( { 1, 3, 5, 7 }, { CLR_BLACK,  CLR_BLACK, CLR_WHITE, CLR_BLACK } )
   oBrw:SetColor( { 2, 4, 6, 8 }, ;
          { { CLR_TK, CLR_TK }, ;  // degraded cells background color
          { CLR_WHITE, CLR_GRAY  }, ;  // degraded headers background color
          { CLR_KGC, CLR_KGC }, ;  // degraded focused line
          { CLR_WHITE, CLR_GRAY} } )  // degraded order column background color
   oBrw:SetColor( { 1, 2 },{ CLR_BLACK, { || Checa_Data() } },8 )
   oBrw:lAutoEdit := .T.
   oBrw:SetDeleteMode( .T., .F. )
   oBrw:SetAppendMode( .T. )
   oBrw:SetBtnGet( 1, "Prod16", { | oGet, dVar | aRect := GetCoors( oGet:hWnd ), ;
        dVar := PesqPco( oGet:Value(), aRect[ 1 ], aRect[ 4 ], oGet:oWnd ), ;
        oGet:cText( dVar ), oGet:Refresh(), oGet:KeyDown( VK_RETURN, 0 ) }, 16 )
   oBrw:SetBtnGet( 2, "Prod16", { | oGet, dVar | aRect := GetCoors( oGet:hWnd ), ;
        dVar := PesqFil( oGet:Value(), aRect[ 1 ], aRect[ 4 ], oGet:oWnd ), ;
        oGet:cText( dVar ), oGet:Refresh(), oGet:KeyDown( VK_RETURN, 0 ) }, 16 )
   oBrw:SetBtnGet( 9, "Prod16", { | oGet, dVar | aRect := GetCoors( oGet:hWnd ), ;
        dVar := PesqVed( oGet:Value(), aRect[ 1 ], aRect[ 4 ], oGet:oWnd ), ;
        oGet:cText( dVar ), oGet:Refresh(), oGet:KeyDown( VK_RETURN, 0 ) }, 16 )

REDEFINE BUTTON oBmpLis ID 69 OF oDlgAna PROMPT "&Listar" ACTION (RelatFrh( 'Agendamento de Títulos a Pagar', { 'CPI','FIL' }, 'agenda', 'R',,,, .f., {'CPI','FIL'} ),oBrw:GoTop(),oBrw:SetFocus(),oBrw:Refresh()) WHEN nOpc = 2
REDEFINE BUTTON oBmpBai ID 63 OF oDlgAna PROMPT "&Baixar" ACTION (Baixa(@nTotal,@nTotalPago,oBrw),oBrw:SetFocus(),oBrw:Refresh())
REDEFINE BUTTON oBmpImp ID 62 OF oDlgAna PROMPT "&Imprimir" ACTION (Imprime(),oBrw:SetFocus(),oBrw:Refresh())
REDEFINE BUTTON oBmpSai ID 68 OF oDlgAna PROMPT "&Fechar" ACTION (Libera_tudo(oDlgAna), oDlgAna:End())

ACTIVATE DIALOG oDlgAna CENTERED ON INIT oDlgAna:lHelpIcon:=.F.

DbCloseAll()
Libera_tudo(oDlgAna)

return nil
Kleyber Derick

FWH / xHb / xDevStudio / SQLLIB
User avatar
Kleyber
 
Posts: 581
Joined: Tue Oct 11, 2005 11:28 am
Location: São Luiz, Brasil

Postby James Bott » Sun Aug 03, 2008 8:34 pm

Kleyber,

OK, the first thing I notice is:

set relation to loja into FIL

This other file is not being displayed in the browse, so I don't think it is necessary. The use of SET RELATION is going to cause the reading of two records for each skip in the browsed database, which will dramatically slow down the refresh.

If you are using this database in one of your function calls, then you don't need to keep updating the record for each movement in the browsed database. Instead you can do one seek when the function is called.

I would also get rid of these codeblocks in the column definitions:

FieldWBlock( "ccusto", Select( "CPI" ) )

as they are not needed, just specify the fieldname. You will need to add:

oBrw:setRDD()

Those two changes should speed up the browse considerably. Please time it before and after, and I suggest running multiple time tests on each version, then finding the average for each. Let us know what you find out.

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby Kleyber » Sun Aug 03, 2008 10:34 pm

James,

In a day like Sunday it's a pleasure to receive your answer ;=)) I'll try what you said and will post the results here.

Thanks a lot for your support (even in a Sunday),
Kleyber Derick

FWH / xHb / xDevStudio / SQLLIB
User avatar
Kleyber
 
Posts: 581
Joined: Tue Oct 11, 2005 11:28 am
Location: São Luiz, Brasil

Postby Otto » Mon Aug 04, 2008 6:02 am

OT: For James
I tried to send you an email?
Did you receive it?
Best regards,
Otto
User avatar
Otto
 
Posts: 6328
Joined: Fri Oct 07, 2005 7:07 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 53 guests