mike_hartshorn2 | 1 Nov 13:11
Picon
Favicon

Re: thinlet using vectors


Hi Campbell,

> Thanks for the patch link.  I confirm that the patch eliminates the
> JVM crash for huge lists regarding the tree control (and presumably
> all other previous linked list type access patterns in Thinlet).
> 
> So, for me, your patch is the start of A GoodThing(tm) :-).

Glad the patch proved useful for you.

My main goal in the approach to this problem was
to have a minimal patch that could be applied to
future versions of thinlet, with very little pain.
I really need to be able to display tables/trees
that will occasionally be in the 1-2000 element size.
I'd like to think that we can get some sort of fix
in place for this, but appreciate that this approach
might not be to everyone's taste (although it does
coexist with the original implementation) and so
might not end up in the core thinlet.

> But, as you have stated, the patch needs some refinements:
> 
> And here's a first...
> 
> The symptom I'm seeing with your patch (that I do not see with the
> original code) is that as one scrolls down further
> ...
> then scrolling gets slower and slower, until the delay becomes
(Continue reading)

cgbburnet | 2 Nov 05:50
Picon

Re: thinlet using vectors


Thanks Mike.

--- In thinlet <at> yahoogroups.com, "mike_hartshorn2"
<mike_hartshorn <at> h...> wrote:
> 
> Hi Campbell,
> 
> > Thanks for the patch link.  I confirm that the patch eliminates the
> > JVM crash for huge lists regarding the tree control (and presumably
> > all other previous linked list type access patterns in Thinlet).
> > 
> > So, for me, your patch is the start of A GoodThing(tm) :-).
> 
> Glad the patch proved useful for you.
> 
> My main goal in the approach to this problem was
> to have a minimal patch that could be applied to
> future versions of thinlet, with very little pain.
> I really need to be able to display tables/trees
> that will occasionally be in the 1-2000 element size.
> I'd like to think that we can get some sort of fix
> in place for this, but appreciate that this approach
> might not be to everyone's taste (although it does
> coexist with the original implementation) and so
> might not end up in the core thinlet.

Well, I've had this discussion with Robert Bajzat, Andrzej Bialecki,
Eugene Klein and quite a few others, a number of times on the original
forums last year, as well as in semi-private quite recently with both
(Continue reading)

Robert Piotrowski | 23 Dec 16:49
Picon
Favicon

Re: thinlet using vectors


What's the status of this effort?

Are we going this route for large structures?

Is this crash occuring for only certain JVM versions?

Regards,
Robert Piotrowski

--- In thinlet <at> yahoogroups.com, "cgbburnet" <boucherb <at> u...> wrote:
> 
> Thanks Mike.
> 
> --- In thinlet <at> yahoogroups.com, "mike_hartshorn2"
> <mike_hartshorn <at> h...> wrote:
> > 
> > Hi Campbell,
> > 
> > > Thanks for the patch link.  I confirm that the patch eliminates the
> > > JVM crash for huge lists regarding the tree control (and presumably
> > > all other previous linked list type access patterns in Thinlet).
> > > 
> > > So, for me, your patch is the start of A GoodThing(tm) :-).
> > 
> > Glad the patch proved useful for you.
> > 
> > My main goal in the approach to this problem was
> > to have a minimal patch that could be applied to
> > future versions of thinlet, with very little pain.
(Continue reading)

Paul Johnson | 23 Dec 17:05
Picon

Re: Re: thinlet using vectors


I would also like to know.
I have had it crash on the standard windows 1.4.2 jdk.

Paul

  ----- Original Message ----- 
  From: Robert Piotrowski 
  To: thinlet <at> yahoogroups.com 
  Sent: Thursday, December 23, 2004 9:49 AM
  Subject: [thinlet] Re: thinlet using vectors

  What's the status of this effort?

  Are we going this route for large structures?

  Is this crash occuring for only certain JVM versions?

  Regards,
  Robert Piotrowski

  --- In thinlet <at> yahoogroups.com, "cgbburnet" <boucherb <at> u...> wrote:
  > 
  > Thanks Mike.
  > 
  > --- In thinlet <at> yahoogroups.com, "mike_hartshorn2"
  > <mike_hartshorn <at> h...> wrote:
  > > 
  > > Hi Campbell,
  > > 
(Continue reading)

Robert Piotrowski | 23 Dec 22:48
Picon
Favicon

Re: thinlet using vectors


I just tested it (without vectors) on JRE 1.5 (5.0) "update 1" and it
still crashes.

Robert Piotrowski

--- In thinlet <at> yahoogroups.com, "Paul Johnson" <fingers_magoo <at> m...> wrote:
> I would also like to know.
> I have had it crash on the standard windows 1.4.2 jdk.
> 
> Paul
> 
>   ----- Original Message ----- 
>   From: Robert Piotrowski 
>   To: thinlet <at> yahoogroups.com 
>   Sent: Thursday, December 23, 2004 9:49 AM
>   Subject: [thinlet] Re: thinlet using vectors
> 
> 
> 
>   What's the status of this effort?
> 
>   Are we going this route for large structures?
> 
>   Is this crash occuring for only certain JVM versions?
> 
> 
>   Regards,
>   Robert Piotrowski
> 
(Continue reading)

Robert Piotrowski | 29 Dec 18:42
Picon
Favicon

Re: thinlet using vectors


I tried the vector version. It's really slow when you click on a row
and wait for the blue highlight to turn on (even on small tables of
250 rows)

Robert

--- In thinlet <at> yahoogroups.com, "Robert Piotrowski"
<rjpiotrowski <at> y...> wrote:
> 
> I just tested it (without vectors) on JRE 1.5 (5.0) "update 1" and it
> still crashes.
> 
> 
> Robert Piotrowski
> 
> 
> 
> --- In thinlet <at> yahoogroups.com, "Paul Johnson" <fingers_magoo <at> m...>
wrote:
> > I would also like to know.
> > I have had it crash on the standard windows 1.4.2 jdk.
> > 
> > Paul
> > 
> >   ----- Original Message ----- 
> >   From: Robert Piotrowski 
> >   To: thinlet <at> yahoogroups.com 
> >   Sent: Thursday, December 23, 2004 9:49 AM
> >   Subject: [thinlet] Re: thinlet using vectors
(Continue reading)

Robert Piotrowski | 29 Dec 19:28
Picon
Favicon

Re: thinlet using vectors


I narrowed it down.

The getSelectedItem()/getSelectedItems() is a lot slower for vectors

Regards,
Robert

--- In thinlet <at> yahoogroups.com, "Robert Piotrowski"
<rjpiotrowski <at> y...> wrote:
> 
> I tried the vector version. It's really slow when you click on a row
> and wait for the blue highlight to turn on (even on small tables of
> 250 rows)
> 
> 
> 
> Robert
> 
> 
> 
> 
> --- In thinlet <at> yahoogroups.com, "Robert Piotrowski"
> <rjpiotrowski <at> y...> wrote:
> > 
> > I just tested it (without vectors) on JRE 1.5 (5.0) "update 1" and it
> > still crashes.
> > 
> > 
> > Robert Piotrowski
(Continue reading)

Robert Piotrowski | 29 Dec 19:47
Picon
Favicon

Re: thinlet using vectors


And "find()" is a lot slower too.

If you minimize these activities it's almost as fast as the non-vector
thinlet class.

Robert

--- In thinlet <at> yahoogroups.com, "Robert Piotrowski"
<rjpiotrowski <at> y...> wrote:
> 
> I narrowed it down.
> 
> The getSelectedItem()/getSelectedItems() is a lot slower for vectors
> 
> Regards,
> Robert
> 
> --- In thinlet <at> yahoogroups.com, "Robert Piotrowski"
> <rjpiotrowski <at> y...> wrote:
> > 
> > I tried the vector version. It's really slow when you click on a row
> > and wait for the blue highlight to turn on (even on small tables of
> > 250 rows)
> > 
> > 
> > 
> > Robert
> > 
> > 
(Continue reading)

mike_hartshorn2 | 4 Jan 11:18
Picon
Favicon

Re: thinlet using vectors


Hi Robert,

thanks for the feedback about this.

Was this observed with Campbell's changes to the
get() method that are described in 

http://groups.yahoo.com/group/thinlet/message/1063

?

The implementation in the original version
wastes a lot of cycles dealing with 
unnecessary exceptions.

Its worth just bearing in mind that the main
goal for this prototype was to minimise
changes to the original thinlet source code
and demonstrate that the Vector appraoch
solves the VM carsh problem.

Some parts of the code may benefit from 
restructuring to allow for direct traversal
of the Vector object rather than through
the get() interface. I've been reluctant
to do this until some final position
on how to solve the big tree/table/list
problem is reached.

(Continue reading)

Robert Piotrowski | 4 Jan 16:21
Picon
Favicon

Re: thinlet using vectors


Mike,

I grabbed the four(?) methods that were in the "ThinletVector.java"
file that was posted on this site in the "files" section.

It's not as slow as I originally suggested.  The non-vector approach
is so fast that I didn't have to clean up my wastefull development
code.  I've got code that updates a popup on a table based on the row
that's selected.   It was taking alot of CPU cycles for each click. 
Looks like I had too many 'find("my_component_name")' and
'getSelectedItem(find("my_component_name"))'.  So I'm not sure if it's
the "find" or the "getSelectedItem" that needs more processing power.
 I didn't have time to check if they share the some logic, either.

I tested about 25000 rows without a problem with your code.  Regarding
the posting you're referring to, I didn't notice any slow-downs while
scrolling a large table.

I tried 50000 rows but I get a "out of memory error". 25000 should be
enough.  Sure beats 8000 rows.

Should I be using Campbell's patch?

Robert

--- In thinlet <at> yahoogroups.com, "mike_hartshorn2"
<mike_hartshorn <at> h...> wrote:
> 
> Hi Robert,
(Continue reading)

Robert Piotrowski | 4 Jan 17:02
Picon
Favicon

Re: thinlet using vectors


Mike,

I just tried Campbell's patch and it makes row selection noticeably
faster on slower computers (733MHz).

Nothing noticeably different (still fine) on scrolling, however.

Good stuff.

Thanks,
Robert

--- In thinlet <at> yahoogroups.com, "Robert Piotrowski"
<rjpiotrowski <at> y...> wrote:
> 
> Mike,
> 
> I grabbed the four(?) methods that were in the "ThinletVector.java"
> file that was posted on this site in the "files" section.
> 
> It's not as slow as I originally suggested.  The non-vector approach
> is so fast that I didn't have to clean up my wastefull development
> code.  I've got code that updates a popup on a table based on the row
> that's selected.   It was taking alot of CPU cycles for each click. 
> Looks like I had too many 'find("my_component_name")' and
> 'getSelectedItem(find("my_component_name"))'.  So I'm not sure if it's
> the "find" or the "getSelectedItem" that needs more processing power.
>  I didn't have time to check if they share the some logic, either.
> 
(Continue reading)

Andrzej Bialecki | 4 Jan 17:12

Re: Re: thinlet using vectors


Robert Piotrowski wrote:
> 
> Mike,
> 
> I just tried Campbell's patch and it makes row selection noticeably
> faster on slower computers (733MHz).
> 
> Nothing noticeably different (still fine) on scrolling, however.
> 
> Good stuff.

Hi Robert, Mike,

I would like to integrate this patch somehow in the code base. However, 
I can't spend too much time at the moment on Thinlet dev., so I need to 
rely on you guys to do even more work than you did so far... ;-)

Is is possible to switch the implementation at runtime, or is it an 
either/or change? Could you please prepare a final 'diff -u' patch 
relative to the latest Thinlet.java in CVS, and send it to me?

Thanks in advance!

--

-- 
Best regards,
Andrzej Bialecki
  ___. ___ ___ ___ _ _   __________________________________
[__ || __|__/|__||\/|  Information Retrieval, Semantic Web
___|||__||  \|  ||  |  Embedded Unix, System Integration
(Continue reading)

mike_hartshorn2 | 4 Jan 17:56
Picon
Favicon

Re: thinlet using vectors


Hi Andrzej,

the patched version has a single boolean (useVectors)
that controls whether you get the original
behaviour or the Vector style child management.

Currently its static final but could be made just
static. Then you could change it before you create
any Thinlet objects.

The basic mechanism works by intercepting all the
child management calls in just 4 methods.

get(Object component, Object key)
insertItem(Object parent, Object key, Object component, int index)
removeAll(Object component)
removeItemImpl(Object parent, Object component)

I did some memory estimation using a tip on JavaWorld
and found the Vector version uses about 10% more
memory than the original method.

Campbell's changes restructure the get() method
slightly to avoid too much exception handling.

I'll try and get you a diff -u by tomorrow if that is ok.

Mike

(Continue reading)

Andrzej Bialecki | 4 Jan 18:03

Re: Re: thinlet using vectors


mike_hartshorn2 wrote:
> 
> Hi Andrzej,
> 
> the patched version has a single boolean (useVectors)
> that controls whether you get the original
> behaviour or the Vector style child management.

Ok, then the impact is minimal and it's ok to put it into the base version.

> 
> Currently its static final but could be made just
> static. Then you could change it before you create
> any Thinlet objects.

This makes sense. Also, if you have a moment please take a look at the 
problems Robert P. reported...

> I'll try and get you a diff -u by tomorrow if that is ok.

Yes, that would be excellent. Thanks!

--

-- 
Best regards,
Andrzej Bialecki
  ___. ___ ___ ___ _ _   __________________________________
[__ || __|__/|__||\/|  Information Retrieval, Semantic Web
___|||__||  \|  ||  |  Embedded Unix, System Integration
http://www.sigram.com  Contact: info at sigram dot com
(Continue reading)

Robert Piotrowski | 4 Jan 17:26
Picon
Favicon

Re: thinlet using vectors


I just found a problem with Campbell's patch.  When I "remove" a
dialog box from the desktop, I get an exception:

at thinlet.Thinlet.get(Thinlet.java:5851)
here -->        int nextSlot = ( (Integer) get(component,
                                       ":slot")).intValue() + 1; 

at thinlet.Thinlet.setNextFocusable(Thinlet.java:5645)
here -->       if (next == null) {
        next = get(component, ":next");
      }

at thinlet.Thinlet.remove(Thinlet.java:6166)
here -->        if (comp == component) {
          setNextFocusable(parent, false);
          break;

I have to revert back to Mike's patch for now until I have more time
to look at it.

Robert

--- In thinlet <at> yahoogroups.com, Andrzej Bialecki <ab <at> g...> wrote:
> Robert Piotrowski wrote:
> > 
> > Mike,
> > 
> > I just tried Campbell's patch and it makes row selection noticeably
> > faster on slower computers (733MHz).
(Continue reading)

Robert Piotrowski | 4 Jan 17:35
Picon
Favicon

Re: thinlet using vectors


Actually, Mikes patch causes the same problem....

I'll have to diable vectors for now.

Robert

--- In thinlet <at> yahoogroups.com, "Robert Piotrowski"
<rjpiotrowski <at> y...> wrote:
> 
> I just found a problem with Campbell's patch.  When I "remove" a
> dialog box from the desktop, I get an exception:
> 
> at thinlet.Thinlet.get(Thinlet.java:5851)
> here -->        int nextSlot = ( (Integer) get(component,
>                                        ":slot")).intValue() + 1; 
> 
> at thinlet.Thinlet.setNextFocusable(Thinlet.java:5645)
> here -->       if (next == null) {
>         next = get(component, ":next");
>       }
> 
> at thinlet.Thinlet.remove(Thinlet.java:6166)
> here -->        if (comp == component) {
>           setNextFocusable(parent, false);
>           break;
> 
> 
> I have to revert back to Mike's patch for now until I have more time
> to look at it.
(Continue reading)

mike_hartshorn2 | 4 Jan 19:15
Picon
Favicon

Re: thinlet using vectors


Hi Robert,

can you give me a bit more information about this...

I've just been through all the dialog examples
in the drafts demo, and I can't seem to recreate
any problems (I don't have any code to hand that
uses dialogs so I thought I'd use this is a first
step to fixing the problem).

Could you tell me if you can close all the
dialogs in the drafts demo after opening them
using the Vector version?

Mike

> Actually, Mikes patch causes the same problem....
> 
> I'll have to diable vectors for now.
> 
> Robert
> 
> 
> --- In thinlet <at> yahoogroups.com, "Robert Piotrowski"
> <rjpiotrowski <at> y...> wrote:
> > 
> > I just found a problem with Campbell's patch.  When I "remove" a
> > dialog box from the desktop, I get an exception:
> > 
(Continue reading)

Robert Piotrowski | 4 Jan 21:07
Picon
Favicon

Re: thinlet using vectors


Mike, can you email me at bob <at> azonic.net regarding this?

Robert

--- In thinlet <at> yahoogroups.com, "mike_hartshorn2"
<mike_hartshorn <at> h...> wrote:
> 
> Hi Robert,
> 
> can you give me a bit more information about this...
> 
> I've just been through all the dialog examples
> in the drafts demo, and I can't seem to recreate
> any problems (I don't have any code to hand that
> uses dialogs so I thought I'd use this is a first
> step to fixing the problem).
> 
> Could you tell me if you can close all the
> dialogs in the drafts demo after opening them
> using the Vector version?
> 
> Mike
> 
> 
> > Actually, Mikes patch causes the same problem....
> > 
> > I'll have to diable vectors for now.
> > 
> > Robert
(Continue reading)

Robert Piotrowski | 4 Jan 21:25
Picon
Favicon

Re: thinlet using vectors


Yahoo is stripping my email address.  It's bob_at_azonic_dot_net

Robert

--- In thinlet <at> yahoogroups.com, "Robert Piotrowski"
<rjpiotrowski <at> y...> wrote:
> 
> Mike, can you email me at bob <at> a... regarding this?
> 
> 
> Robert
> 
> 
> --- In thinlet <at> yahoogroups.com, "mike_hartshorn2"
> <mike_hartshorn <at> h...> wrote:
> > 
> > Hi Robert,
> > 
> > can you give me a bit more information about this...
> > 
> > I've just been through all the dialog examples
> > in the drafts demo, and I can't seem to recreate
> > any problems (I don't have any code to hand that
> > uses dialogs so I thought I'd use this is a first
> > step to fixing the problem).
> > 
> > Could you tell me if you can close all the
> > dialogs in the drafts demo after opening them
> > using the Vector version?
(Continue reading)

Robert Piotrowski | 4 Jan 23:04
Picon
Favicon

Re: thinlet using vectors ---- found the problem


Found the problem.  If you add a dialog to an empty desktop, the code
chokes when you remove it.  It tries to find the "next" focusable
element on an empty desktop and fails.  Maybe it should be inside the
"try" statement that's two lines below it.

Do you see what I mean?

Robert

--- In thinlet <at> yahoogroups.com, "Robert Piotrowski"
<rjpiotrowski <at> y...> wrote:
> 
> Yahoo is stripping my email address.  It's bob_at_azonic_dot_net
> 
> 
> Robert
> 
> --- In thinlet <at> yahoogroups.com, "Robert Piotrowski"
> <rjpiotrowski <at> y...> wrote:
> > 
> > Mike, can you email me at bob <at> a... regarding this?
> > 
> > 
> > Robert
> > 
> > 
> > --- In thinlet <at> yahoogroups.com, "mike_hartshorn2"
> > <mike_hartshorn <at> h...> wrote:
> > > 
(Continue reading)


Gmane