pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roger L. Whitcomb" <Roger.Whitc...@actian.com>
Subject RE: Slow fade sadness
Date Mon, 26 Aug 2013 23:45:05 GMT
I'm wondering why you needed to copy FadeTransition instead of just
using it?  Just to see why it wasn't working right by commenting out the


I would use VisualVM to do CPU profiling (this is what I've used):
https://visualvm.java.net/profiler.html  So, I don't have any experience
with JConsole.  But, if you have JProfiler I would just use it.  What
you're basically trying to find out is where it is spending all its CPU
time when it goes to 100% (probably using "Hot Spots" view).





From: Erik Innocent [mailto:einnocent@gmail.com] 
Sent: Monday, August 26, 2013 3:12 PM
To: user
Subject: Re: Slow fade sadness


I copied Pivot's FadeTransition.java and commented-out Label.repaint()
in (my copy of FadeTransition's) update().


Any tips on using JConsole with Pivot? Anything I should look for? I've
got it working with my app, but I'm used to using JProfiler and
profiling web apps, not GUI apps.


I'm using Pivot 2.0.3.


Regarding my BlinkDecorator, yeah, I was thinking more or less the same
thing. I grok the relationship between Decorators and Transitions =)






On Mon, Aug 26, 2013 at 4:58 PM, Roger L. Whitcomb
<Roger.Whitcomb@actian.com> wrote:

Hi Erik,

                Interesting problem.  Couple of questions for you:

*         When you comment out the "Label.repaint()" where are you doing
that?  In your code or in FadeTransition.java in Pivot (presumably in
the "update()" method)?

*         Have you done any profiling to see where the CPU utilization
is happening?

*         What version of Pivot are you using?  The reason I ask is I
recall a 100% CPU repaint issue that should have been fixed for 2.0.3.,
but I don't remember where it occurred.

*         Just FYI a FadeTransition is just an animated FadeDecorator,
so analogously your custom decorator could probably be a custom
transition that uses your custom decorator (OnOffDecorator that has a
single boolean state), and then the transition just toggles the
decorator state in the "update" method...  Just thinking out loud...




From: Erik Innocent [mailto:einnocent@gmail.com] 
Sent: Monday, August 26, 2013 2:42 PM
To: user
Subject: Slow fade sadness


Hi, all! I've got a new and fun problem to discuss with you. So, I'm
using the FadeTransition to fade a label. Concurrently, I'm sometimes
using a custom decorator to blink an image. (Come to think of it, maybe
a Transition would technically be more appropriate for blinking than a
Decorator, but whatever...) The fade lasts about two seconds, and the
blinking five seconds (when it happens).


I've noticed a few things, on my Macbook Pro i7 2.7GHz with 8GB and
otherwise low CPU load...

*	I've got the FadeTransition set to 10Hz, but the fade calls hit
at around once per 300ms with 100% CPU utilization
*	If I comment-out the Label.repaint() method, the fade calls hit
every 100ms, as intended (but no fading happens, of course)
*	The image blinking is configured for 2Hz, but during the fade,
the blinks are irregular due to high CPU load. When the fading stops,
the blinks become regular. This is my biggest issue, since it looks
really bad.

I'm considering trying something advanced, like passing the
Label.repaint() call to an Executor so it doesn't block, and then the
blink callback can hit in a timely manner. But I'm reading Java
Concurrency in Action, chapter 9 ("GUI Applications"), and it talks
about how most GUI frameworks (including Swing... which Pivot sits on,
right?) are already single-threaded, and for a reason. I'm going to try
the Executor and see how it works, though I'm guessing I'll just be
shifting the issue from one thread to another, but I have to try
something. In the mean time, I'm curious to hear if you have advice
regarding this slow redraw issue I'm seeing that is causing the
blocking. Maybe there is a non-blocking Component.redraw() I don't know
about... =)


Thanks in advance for your time!






View raw message