improve cache trace output
now shows '*' for cache hit, lists output args as well
This commit is contained in:
parent
d8018e8126
commit
951019fcbc
@ -757,7 +757,7 @@ vips_cache_operation_lookup( VipsOperation *operation )
|
||||
|
||||
if( (hit = g_hash_table_lookup( vips_cache_table, operation )) ) {
|
||||
if( vips__cache_trace ) {
|
||||
printf( "vips cache-: " );
|
||||
printf( "vips cache*: " );
|
||||
vips_object_print_summary( VIPS_OBJECT( operation ) );
|
||||
}
|
||||
|
||||
@ -788,19 +788,21 @@ vips_cache_operation_add( VipsOperation *operation )
|
||||
* https://github.com/jcupitt/libvips/pull/181
|
||||
*/
|
||||
if( !g_hash_table_lookup( vips_cache_table, operation ) ) {
|
||||
VipsOperationFlags flags =
|
||||
vips_operation_get_flags( operation );
|
||||
gboolean nocache = flags & VIPS_OPERATION_NOCACHE;
|
||||
|
||||
/* Has to be after _build() so we can see output args.
|
||||
*/
|
||||
if( vips__cache_trace ) {
|
||||
if( vips_operation_get_flags( operation ) &
|
||||
VIPS_OPERATION_NOCACHE )
|
||||
if( nocache )
|
||||
printf( "vips cache : " );
|
||||
else
|
||||
printf( "vips cache+: " );
|
||||
vips_object_print_summary( VIPS_OBJECT( operation ) );
|
||||
}
|
||||
|
||||
if( !(vips_operation_get_flags( operation ) &
|
||||
VIPS_OPERATION_NOCACHE) )
|
||||
if( !nocache )
|
||||
vips_cache_insert( operation );
|
||||
}
|
||||
|
||||
@ -843,7 +845,6 @@ vips_cache_operation_buildp( VipsOperation **operation )
|
||||
vips_cache_operation_add( *operation );
|
||||
}
|
||||
|
||||
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
|
@ -504,9 +504,11 @@ vips_operation_vips_operation_print_summary_arg( VipsObject *object,
|
||||
{
|
||||
VipsBuf *buf = (VipsBuf *) a;
|
||||
|
||||
/* Just assigned input construct args
|
||||
/* Just assigned input and output construct args. _summary() is used
|
||||
* for things like cache tracing, so it's useful to show output args.
|
||||
*/
|
||||
if( (argument_class->flags & VIPS_ARGUMENT_INPUT) &&
|
||||
if( ((argument_class->flags & VIPS_ARGUMENT_INPUT) ||
|
||||
(argument_class->flags & VIPS_ARGUMENT_OUTPUT)) &&
|
||||
(argument_class->flags & VIPS_ARGUMENT_CONSTRUCT) &&
|
||||
argument_instance->assigned ) {
|
||||
const char *name = g_param_spec_get_name( pspec );
|
||||
|
Loading…
Reference in New Issue
Block a user