better memuse graph

This commit is contained in:
John Cupitt 2013-12-09 15:14:54 +00:00
parent b3d31ced79
commit c0b8b67987
3 changed files with 25 additions and 14 deletions

View File

@ -154,9 +154,6 @@ void vips__region_take_ownership( struct _VipsRegion *reg );
void vips__region_check_ownership( struct _VipsRegion *reg );
void vips__region_no_ownership( struct _VipsRegion *reg );
int vips__region_start( struct _VipsRegion *reg );
void vips__region_stop( struct _VipsRegion *reg );
typedef int (*VipsRegionFillFn)( struct _VipsRegion *, void * );
int vips_region_fill( struct _VipsRegion *reg,
VipsRect *r, VipsRegionFillFn fn, void *a );

View File

@ -75,8 +75,8 @@
/*
#define DEBUG_MOVE
#define DEBUG_ENVIRONMENT 1
#define DEBUG_CREATE
#define DEBUG
#define VIPS_DEBUG
*/
#ifdef HAVE_CONFIG_H
@ -199,7 +199,7 @@ vips_region_finalize( GObject *gobject )
/* Call a start function if no sequence is running on this VipsRegion.
*/
int
static int
vips__region_start( VipsRegion *region )
{
VipsImage *image = region->im;
@ -229,7 +229,7 @@ vips__region_start( VipsRegion *region )
/* Call a stop function if a sequence is running in this VipsRegion.
*/
void
static void
vips__region_stop( VipsRegion *region )
{
IMAGE *image = region->im;
@ -267,7 +267,7 @@ vips_region_dispose( GObject *gobject )
VipsImage *image = region->im;
#ifdef VIPS_DEBUG
VIPS_DEBUG_MSG( "vips_region_dispose: " );
printf( "vips_region_dispose: \n" );
vips_object_print_name( VIPS_OBJECT( gobject ) );
#endif /*VIPS_DEBUG*/
@ -493,6 +493,10 @@ vips_region_new( VipsImage *image )
{
VipsRegion *region;
/*
printf( "vips_region_new: on image %p\n", image );
*/
/* Ref quickly, we want to make sure we keep the image around.
* We can't use the property system, we need to be very threaded.
*/

24
tools/vipsprofile Executable file → Normal file
View File

@ -370,20 +370,30 @@ for thread in threads:
for event in thread.events:
draw_event(ctx, event)
memory_y = total_y * PIXELS_PER_GATE
label = "memory"
xbearing, ybearing, twidth, theight, xadvance, yadvance = \
ctx.text_extents(label)
ctx.move_to(0, memory_y + theight + 8)
ctx.set_source_rgb(1.00, 1.00, 1.00)
ctx.show_text(label)
memory = 0
ctx.move_to(LEFT_BORDER, memory_y + MEM_HEIGHT)
for event in all_events:
if event.memory:
memory += event.size
left = LEFT_BORDER + event.start * PIXELS_PER_SECOND
top = total_y * PIXELS_PER_GATE + MEM_HEIGHT
top -= MEM_HEIGHT * memory / peak_memory
width = 1
height = 1
top = memory_y + MEM_HEIGHT - (MEM_HEIGHT * memory / peak_memory)
ctx.rectangle(left, top, width, height)
ctx.set_source_rgb(1.00, 1.00, 1.00)
ctx.fill()
ctx.line_to(left, top)
ctx.set_line_width(1)
ctx.set_source_rgb(1.00, 1.00, 1.00)
ctx.stroke()
axis_y = total_y * PIXELS_PER_GATE + MEM_HEIGHT