Home > Archive > Programming with dBASE > December 2005 > Clarification on notifyControls









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Clarification on notifyControls
evilaro

2005-12-03, 1:23 pm

To all:

I have a grid linked to a table
and I do some do while proceses

The speed is much faster if I put the notify controls
to false on the grid.

But I assumed that if I made the grid not visible , it
would have the same effect...

But big mistake.

So I would like to confirm this.

Is it true?

Also ... why would a grid that is not visible
can act as if it had the notifycontrol=true
I feel it does not make much sense..

Please comment.

Emilio





Jean-Pierre Martel

2005-12-04, 3:23 am

In article <wD6dkND#FHA.892@news-server>, buzon@evil.es says...
>
> Is it true?


Yes, that's true.

> why would a grid that is not visible
> can act as if it had the notifycontrol=true
> I feel it does not make much sense..


There are many things that a programmer might want to do with an
invisible object. If dBASE decide that the value of non-visible objects
(or out of view objects) should not be updated, then it will overrule the
will of many developers.

As much as possible, dBASE gives the power to the developers: Emilio, do
you really want to change that? ;-)

Jean-Pierre Martel, editor
The dBASE Developers Bulletin
Blue Star dBASE Plus Core Concepts Graduate
Mervyn Bick

2005-12-04, 3:23 am

On Sun, 04 Dec 2005 06:14:01 +0200, Jean-Pierre Martel <nospam@nospam.com>
wrote:

......
> As much as possible, dBASE gives the power to the developers: Emilio, do
> you really want to change that? ;-)



I don't think Emilio was suggesting any change to dBase but rather that he
was expressing surprise that turning off notification to a grid during
extended processing made a significant speed difference to his program
whereas simply making the grid invisible while things happened in the
background did not.

It may not be true (because I don't know exactly how dBase does these
things) but to answer Emilio's question it looks as if dbase does far more
work behind the scenes to populate a grid than it does to display the
results on the screen. In most cases this probably doesn't matter as one
fetches a set of values once and then they are displayed immediately.
Still, the facility to turn off the notification, which defaults on, when
necessary is there if one needs to and Emilio has found out the hard way
that the small extra effort of doing this has made a difference to his
particular program's response time.

All of this brings another thought. In days of yore, when dBase II ran
(crawled <g> ) on a 1Mhz Apple with a Z80 card (or III+ on a 16Mhz XT if
one was lucky) with 64Mb memory, programmers would spend a significant
amount of time optimising code to squeeze every last unnecessary
processing cycle out of the program. Now-a-days, when a 1.6Ghz machine is
considered slow and multi-Gb memories are commonplace, there isn't the
same urgency to optimise code but there are still cases, as Emilio
discovered, where a little bit of effort is well worth the trouble.
Perhaps this topic could be a chapter in Ken's next book. (Ken, are you
out there? <g> )

Mervyn.
evilaro

2005-12-04, 7:23 am

Jean-Peirre:

>
> Yes, that's true.


That makes me sleep well... thanks.


>
>
> There are many things that a programmer might want to do with an
> invisible object. If dBASE decide that the value of non-visible objects
> (or out of view objects) should not be updated, then it will overrule the
> will of many developers.
>
> As much as possible, dBASE gives the power to the developers: Emilio, do
> you really want to change that? ;-)


Noooooooooo... If I know how it works, and how to avoid it ... I am more
happy
than a cake...

Still
If I tell you to GetLOst .... and you while onGetLOst you keep nagging me
I will feel
I would have to use some stronger wording ;)

Hey I like this onGetLOSt ... I could use it a lot of times ..

OnGetLost(Call JP)
Return(I am not there)/(How can I help)

Thak you really
Emilio



Thank you





evilaro

2005-12-04, 7:23 am

> I don't think Emilio was suggesting any change to dBase but rather that he
> was expressing surprise that turning off notification to a grid during
> extended processing made a significant speed difference to his program
> whereas simply making the grid invisible while things happened in the
> background did not.


Suggest changes? ..... gosh .... nooooooooooooo
First I need to understand what I got ... I have a dead(real) limit on year
2098



> It may not be true (because I don't know exactly how dBase does these
> things) but to answer Emilio's question it looks as if dbase does far more
> work behind the scenes to populate a grid than it does to display the
> results on the screen. In most cases this probably doesn't matter as one
> fetches a set of values once and then they are displayed immediately.
> Still, the facility to turn off the notification, which defaults on, when
> necessary is there if one needs to and Emilio has found out the hard way
> that the small extra effort of doing this has made a difference to his
> particular program's response time.


For sure it is doing things... and it took me a few hours to realize
the problem. And the difference is important.


> All of this brings another thought. In days of yore, when dBase II ran
> (crawled <g> ) on a 1Mhz Apple with a Z80 card (or III+ on a 16Mhz XT if
> one was lucky) with 64Mb memory, programmers would spend a significant
> amount of time optimising code to squeeze every last unnecessary
> processing cycle out of the program. Now-a-days, when a 1.6Ghz machine is
> considered slow and multi-Gb memories are commonplace, there isn't the
> same urgency to optimise code but there are still cases, as Emilio
> discovered, where a little bit of effort is well worth the trouble.
> Perhaps this topic could be a chapter in Ken's next book. (Ken, are you
> out there? <g> )


How did you know what I was thinking ????
I was thinking... at this speed ... the whole proces IS not acceptable
How big my table will be to make it on procesable, and how much the new
64 bit computers will help out?
Fourtunatelly all is okay now.

Thanks for you time.

Emilio



Mervyn Bick

2005-12-04, 7:23 am

On Sun, 04 Dec 2005 11:40:17 +0200, evilaro <buzon@evil.es> wrote:

......
> How did you know what I was thinking ????
> I was thinking... at this speed ... the whole proces IS not acceptable
> How big my table will be to make it on procesable, and how much the new
> 64 bit computers will help out?
> Fourtunatelly all is okay now.


Emilio

As a matter of interest, how many times does your prgram go through the
do...while loop and how long did it take with notification on and how long
did it take with notification off? What computer are you running?

Mervyn.


evilaro

2005-12-04, 7:23 am

Mervyn:

The table has 35000 rows, and depending of the condition that are
found the time is different... but for a given example
it takes 5 seconds.
The proces takes long because is searching 2 words in any place of the row.
in a complicated way.

Whereas if the control is true it takes 2min 20 sec.
If I make the grid invisible it helps... maybe it drops 1/2 minute
So the improvement is important.

Emilio


> As a matter of interest, how many times does your prgram go through the
> do...while loop and how long did it take with notification on and how long
> did it take with notification off? What computer are you running?
>
> Mervyn.
>
>



Mervyn Bick

2005-12-04, 9:23 am

On Sun, 04 Dec 2005 13:47:44 +0200, evilaro <buzon@evil.es> wrote:


> The table has 35000 rows, and depending of the condition that are
> found the time is different... but for a given example it takes 5
> seconds.
> The proces takes long because is searching 2 words in any place of the
> row.
> in a complicated way.
>
> Whereas if the control is true it takes 2min 20 sec.
> If I make the grid invisible it helps... maybe it drops 1/2 minute
> So the improvement is important.


Emilio

Reducing the time it takes for a process from 140 seconds to 5 seconds is
a significant improvement! How much improvement one gets obviously
depends on the number of records involved and exactly what one is doing
but turning off the notifyControls property of a rowset while looping
through the entire file is something to keep at the back of one's mind.

Mervyn.
Todd Kreuter

2005-12-05, 7:23 am

evilaro wrote:
>
> Is it true?
>
> Also ... why would a grid that is not visible
> can act as if it had the notifycontrol=true
> I feel it does not make much sense..


Hello Emilio

The data objects have no clue that any of its datalinked objects are
visible or not, so they continue to make every attempt to update the
visual controls, unless you say otherwise by setting notifyContols =
false.

--
Todd Kreuter [dBVIPS]
Ken Mayer [dBVIPS]

2005-12-05, 9:23 am

evilaro wrote:
> To all:
>
> I have a grid linked to a table
> and I do some do while proceses
>
> The speed is much faster if I put the notify controls
> to false on the grid.
>
> But I assumed that if I made the grid not visible , it
> would have the same effect...
>
> But big mistake.
>
> So I would like to confirm this.
>
> Is it true?
>
> Also ... why would a grid that is not visible
> can act as if it had the notifycontrol=true
> I feel it does not make much sense..


dBASE is still updating it, so that as soon as you set the visible
property to true, it is up to date ....

Ken

--
/(Opinions expressed are purely my own, not those of dataBased
Intelligence, Inc.)/

*Ken Mayer* [dBVIPS]
/Golden Stag Productions/
dBASE at goldenstag dot net
http://www.goldenstag.net/dbase/dBASEBook.htm
http://www.goldenstag.net/GSP
http://www.goldenstag.net/dbase
evilaro

2005-12-05, 9:23 am

Todd:

With your comment + Kens Its clear now.

Thanks
Emilio

"Todd Kreuter" <tkreuter@dbvips.usa> escribió en el mensaje
news:439438B2.A834E7D6@dbvips.usa...
> evilaro wrote:
>
> Hello Emilio
>
> The data objects have no clue that any of its datalinked objects are
> visible or not, so they continue to make every attempt to update the
> visual controls, unless you say otherwise by setting notifyContols =
> false.
>
> --
> Todd Kreuter [dBVIPS]



evilaro

2005-12-05, 9:23 am

Ken:

Very well explained....

Have you been reading Ken's new book... ???

Emilio ;)



> dBASE is still updating it, so that as soon as you set the visible
> property to true, it is up to date ....



> --
> /(Opinions expressed are purely my own, not those of dataBased
> Intelligence, Inc.)/
>
> *Ken Mayer* [dBVIPS]
> /Golden Stag Productions/
> dBASE at goldenstag dot net
> http://www.goldenstag.net/dbase/dBASEBook.htm
> http://www.goldenstag.net/GSP
> http://www.goldenstag.net/dbase



Ken Mayer [dBVIPS]

2005-12-05, 11:23 am

evilaro wrote:
> Ken:
>
> Very well explained....
>
> Have you been reading Ken's new book... ???


Um, I have some vague memory of having done so. <g>

Ken

--
/(Opinions expressed are purely my own, not those of dataBased
Intelligence, Inc.)/

*Ken Mayer* [dBVIPS]
/Golden Stag Productions/
dBASE at goldenstag dot net
http://www.goldenstag.net/dbase/dBASEBook.htm
http://www.goldenstag.net/GSP
http://www.goldenstag.net/dbase
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com