larger seq cache

Make the seq cache 50% larger to allow for rounding with some image
widths, tile sizes and thread numbers.

See https://github.com/libvips/libvips/issues/1494#issuecomment-567190830
This commit is contained in:
John Cupitt 2019-12-19 15:26:10 +00:00
parent 4616cf1f5c
commit 53dac98b55
2 changed files with 3 additions and 4 deletions

View File

@ -937,8 +937,7 @@ vips_line_cache_build( VipsObject *object )
block_cache->tile_width = block_cache->in->Xsize; block_cache->tile_width = block_cache->in->Xsize;
/* Output has two buffers n_lines height, so 2 * n_lines is the maximum /* Output has two buffers n_lines height, so 2 * n_lines is the maximum
* non-locality from threading. Add another n_lines for conv / reducev * non-locality from threading. Double again for conv, rounding, etc.
* etc.
* *
* tile_height can be huge for things like tiff read, where we can * tile_height can be huge for things like tiff read, where we can
* have a whole strip in a single tile ... we still need to have a * have a whole strip in a single tile ... we still need to have a
@ -946,7 +945,7 @@ vips_line_cache_build( VipsObject *object )
* tile boundary. * tile boundary.
*/ */
block_cache->max_tiles = VIPS_MAX( 2, block_cache->max_tiles = VIPS_MAX( 2,
3 * n_lines / block_cache->tile_height ); 4 * n_lines / block_cache->tile_height );
VIPS_DEBUG_MSG( "vips_line_cache_build: n_lines = %d\n", VIPS_DEBUG_MSG( "vips_line_cache_build: n_lines = %d\n",
n_lines ); n_lines );

View File

@ -254,7 +254,7 @@ wbuffer_flush( Write *write )
if( write->buf->area.top > 0 ) { if( write->buf->area.top > 0 ) {
vips_semaphore_down( &write->buf_back->done ); vips_semaphore_down( &write->buf_back->done );
/* Previous write suceeded? /* Previous write succeeded?
*/ */
if( write->buf_back->write_errno ) { if( write->buf_back->write_errno ) {
vips_error_system( write->buf_back->write_errno, vips_error_system( write->buf_back->write_errno,