Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-swt-dev] Super sleak

I'm putting together an EclipseCon talk titled: Super sleak The
presentation focuses on changes I've made to Sleak that I and others
have found very useful. I'm interested in contributing them but wanted
to run them by folks here first.

They are:
1) Find duplicate images, fonts, colors
This has been great to find places that images should be shared but
aren't.

2) Track resources with timestamps.
I basically added a timestamp column to the UI. This has proved useful
when looking at resource usage over time.

My implementation is limited because I didn't modify SWT, which means
in reality it's the time you snapped instead of the time the resource
was created. Useful but I would prefer to track the creation time.

It would be a straightforward change to Device, basically adding a
long[] beside the error and object[], or better yet add a callback
that Sleak could hook and track the times itself.

3) Track image burn.
Image burn is when an image is persistently created and disposed. This
may indicate a performance problem, misunderstanding, etc.
In addition to the "# of duplicates" column I added a "times created"
column which tells you how many times you've snapped this
image/color/font.

For example, this could tell you that you have 1 "live" image but
you've created that image 20 previous times. Because of how Sleak is
implemented, it means you've snapped 20 previous times to "know" that
the create/dispose occurred.

The changes I've made in Sleak are useful, but even better tracking
and fidelity could be achieved if Device.dispose_Object and
Device.new_Object provided a callback.

I understand the performance and safety implications that adding a
callback introduce but since those methods are already guard-claused
the impact would be minimal.

So specifically, what do folks think of:

A. Adding an SWT callback to dispose_Object/new_Object
B. Changing Sleak to use the callback
C. Contribute the Sleak changes mentioned above

I'd love to make the changes,
Chris
-- 
Chris Grindstaff | http://gstaff.org



Back to the top