http://gwt-code-reviews.appspot.com/1361801/diff/1/dev/core/src/com/google/gwt/dev/util/log/speedtracer/SpeedTracerLogger.java
File
dev/core/src/com/google/gwt/dev/util/log/speedtracer/SpeedTracerLogger.java
(right):
http://gwt-code-reviews.appspot.com/1361801/diff/1/dev/core/src/com/google/gwt/dev/util/log/speedtracer/SpeedTracerLogger.java#newcode364
dev/core/src/com/google/gwt/dev/util/log/speedtracer/SpeedTracerLogger.java:364:
}
On 2011/02/23 19:51:14, jbrosenberg wrote:
I think too, the check do a flush should occur after the logic
handling the
current event (if event != null). Otherwise you do a flush, followed
by writing
an event. In otherwords, move the lastFlush logic to the end of the
routine
(and don't do it if you just saw the flushSentinel?)...
Good idea. An extra flush is a no-op, so it doesn't hurt.
http://gwt-code-reviews.appspot.com/1361801/diff/1/dev/core/src/com/google/gwt/dev/util/log/speedtracer/SpeedTracerLogger.java#newcode364
dev/core/src/com/google/gwt/dev/util/log/speedtracer/SpeedTracerLogger.java:364:
}
On 2011/02/23 19:10:44, scottb wrote:
On 2011/02/23 19:08:12, scottb wrote:
> Total matter of opinion, but seems slightly easier to follow if the
thing you
> track is "nextFlush" ala:
>
> long nextFlush = lastFlush + FLUSH_TIMER_MSECS;
> poll(nextFlush - System.CTM()) // okay to be negative?
> if (System.CTM() >= nextFlush) { ... }
Come to think of it, you wouldn't need to track lastFlush.
Done.
http://gwt-code-reviews.appspot.com/1361801/diff/1/dev/core/src/com/google/gwt/dev/util/log/speedtracer/SpeedTracerLogger.java#newcode368
dev/core/src/com/google/gwt/dev/util/log/speedtracer/SpeedTracerLogger.java:368:
break;
On 2011/02/23 19:08:12, scottb wrote:
FYI: this is a potential behavioral change, the old code would drain
the queue
to empty after encountering a shutdown. I don't know whether or not
this
matters in practice.
Unless someone is writing speedtracer events in a shutdown hook (and woe
be unto them if they are), the receipt of the shutdown sentinel should
be the last event on the queue. I don't understand why the old logic
was that complex.
http://gwt-code-reviews.appspot.com/1361801/
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors