Although the clean-first strategy gives fast light-load performance,
it also degrades catastrophically under moderate cache pressure. LRU is
not as efficient under light load, but degrades more gracefully under
moderate and heavy load.
Add more profiling In order to analyze efficiency and behavior of the
tile cache. Profiling includes run-time indication of idle swapper
activity.
Also, fixes to original tile profiling code that appears to have
bitrotted some; it was no longer tracking changes made to tile memory
outside of tile.c.
2009-01-17 Michael Natterer <mitch@gimp.org>
* all files with a GPL header and all COPYING files:
Change licence to GPLv3 (and to LGPLv3 for libgimp).
Cleaned up some copyright headers and regenerated the parsers in
the ImageMap plugin.
svn path=/trunk/; revision=27913
2008-08-25 Sven Neumann <sven@gimp.org>
* app/base/tile-manager.c (read_pixel_data_1): changed to
silently
return in case of out-of-bounds access. There's code that relies
on this.
* app/base/pixel-surround.[ch]: added SMEAR as another edge
strategy for the PixelSurround helper.
* core/gimp-transform-region.c: changed accordingly.
svn path=/trunk/; revision=26767
2008-08-25 Sven Neumann <sven@gimp.org>
* app/base/tile-private.h: provide a macro version of
tile_data_pointer().
* app/base/tile.c (tile_data_pointer): turned into a wrapper
around the TILE_DATA_POINTER() macro.
* app/base/tile-manager.c (read_pixel_data) (read_pixel_data_1)
(write_pixel_data) (write_pixel_data_1): access tile struct
members directly and use the new macro to access the tile data.
svn path=/trunk/; revision=26757
2008-08-25 Sven Neumann <sven@gimp.org>
* app/base/tile-manager.c (read_pixel_data_1): removed redundant
check that is already performed by tile_manager_get_tile_num().
Warn if an out-of-bounds read is requested, instead of silently
doing nothing.
svn path=/trunk/; revision=26755
2008-08-08 Sven Neumann <sven@gimp.org>
* app/base/tile-manager.c: implement
tile_manager_get_tile_coordinates() by calling
tile_manager_get_tile_col_row() instead of the other way around.
Saves two multiplications and divisions for each call of
tile_manager_get_tile_col_row().
svn path=/trunk/; revision=26446
2008-08-07 Sven Neumann <sven@gimp.org>
* app/base/tile-manager.c (tile_manager_invalidate_tile): fixed
broken copy-on-write code. The old code did not insert the new
tile in the tile-manager's tile pointer array.
(tile_manager_map): changed in a similar way as
tile_manager_invalidate_tile(). This code was not broken, but it
is easier to read now.
* app/base/tile-private.h: moved a comment.
* app/core/gimpselection.c (gimp_selection_extract): removed
workaround for above bug.
svn path=/trunk/; revision=26419
2008-01-28 Michael Natterer <mitch@gimp.org>
* app/base/tile-manager.c
* plug-ins/common/lcms.c: use G_STRLOC instead of
G_GNUC_FUNCTION (which is now deprecated).
svn path=/trunk/; revision=24727
2007-12-29 Michael Natterer <mitch@gimp.org>
* app/base/tile-manager.[ch]: add boxed type GIMP_TYPE_TILE_MANAGER.
* app/gegl/gimpoperationtilesink.c
* app/gegl/gimpoperationtilesource.c: use GParamSpecBoxed instead
of GParamSpecPointer for the tile-manager properties and ref them
properly. Some cleanup.
svn path=/trunk/; revision=24465
2007-12-18 Sven Neumann <sven@gimp.org>
* app/base/tile-manager.[ch]: renamed tile_manager_validate() to
tile_manager_validate_tile(). If no validate_proc is set,
initialize the tile data to all zero when validating it. This way
we never hand out uninitialized data and valgrind doesn't need to
complain any longer.
* app/base/tile.c: changed accordingly.
* app/core/gimpselection.c: no need to set an extra validate_proc
here as the default implementation now does the job for us.
svn path=/trunk/; revision=24389
2007-11-30 Sven Neumann <sven@gimp.org>
* app/base/tile-manager.c (tile_manager_invalidate_area): if no
tiles have been allocated, there's no need to invalidate any.
Should fix bug #500178.
svn path=/trunk/; revision=24244
2007-09-07 Michael Natterer <mitch@gimp.org>
* app/base/tile-manager.c (read_pixel_data_1): use a temporary
variable to store the return value of tile_manager_get() instead
of assigning to tm->cached_tile directly to make sure
tm->cached_num and tm->cached_tile are always in a consistent
state (the requested tile might be invalid and needs to be
validated, which would call tile_manager_get() recursively, which
in turn would clear the cached tile). Fixes bug #472770.
svn path=/trunk/; revision=23472
2007-08-31 Michael Natterer <mitch@gimp.org>
* app/base/tile-manager.c (tile_manager_get): if
tile_manager->cached_tile is requested for writing, clear the
cache before giving out the tile. Fixes bug #472170.
svn path=/trunk/; revision=23425
2007-06-21 Sven Neumann <sven@gimp.org>
* app/base/tile-manager.[ch]
* app/base/tile-manager-private.h: removed "level_below" from the
TileManager struct.
* app/base/tile-pyramid.c: use the TileManager's user_data to
store a pointer to the lower level.
svn path=/trunk/; revision=22819
2007-06-21 Sven Neumann <sven@gimp.org>
* app/base/tile-manager.[ch]: use gboolean for boolean parameters.
* app/base/tile-pyramid.c (tile_pyramid_get_memsize): pass TRUE
for sparse to tile_manager_get_memsize().
* app/base/tile.c
* app/base/tile-swap.c: minor cleanups.
* app/core/gimpprojection.c (gimp_projection_get_tiles_at_level):
inline the creation of the TilePyramid.
svn path=/trunk/; revision=22818
2007-06-20 Sven Neumann <sven@gimp.org>
* app/base/tile.[ch]: removed unused function tile_mark_valid().
* app/base/tile-manager.[ch]: removed unused public API and cleaned
up internals used for invalidating tiles.
svn path=/trunk/; revision=22806
2007-06-06 Martin Nordholts <martinn@svn.gnome.org>
Implemented an image pyramid for the GimpProjection. An image pyramid
caches a projection at several sizes, causing the rendering code not to
have to swap in all tiles of a (potentially) large image; it can use
small versions of the projection if the user is zoomed out.
The image pyramid also imroves visual quality, especially at zoom levels
where there is a pyramid level that matches perfectly (i.e. at e.g. 50%,
25%, and 12.5% zoom). A step on the right track for bug #76096.
* app/core/gimpprojection.[ch]: Adjusted to make use of an image
pyramid. GimpProjection now keeps an array of TileManager:s, one per
pyramid level. Renamed _alloc_tiles to _alloc_levels.
* app/display/gimpdisplayshell-draw.c: (gimp_display_shell_draw_area):
Use the right GimpProjection level when drawing
* app/display/gimpdisplayshell-render.c: (render_image_init_info_full):
Setup RenderInfo with level in mind
* app/base/tile-manager.[ch]: Extended API a bit, nothing complicated.
* app/base/tile-manager-private.h (struct _TileManager): Keep a pointer
to the level below for use in an image pyramid.
svn path=/trunk/; revision=22727
2007-05-22 Michael Natterer <mitch@gimp.org>
* app/base/tile.[ch]: changed tile_init() to tile_new() and return
a GSlice-allocated Tile structure.
(tile_destroy): free it using GSLice.
* app/base/tile-manager.c: use tile_new() instead of g_new plus
tile_init(). Also allocate TileManager itself using GSlice.
* app/xcf/xcf-load.c (xcf_load_parasite): allocate parasites using
gimp_parasite_new().
svn path=/trunk/; revision=22571
2007-05-16 Sven Neumann <sven@gimp.org>
* app/base/tile-manager.c (tile_invalidate): if the invalided tile
is the cached tile, release the cached tile. Fixes bug #438802.
svn path=/trunk/; revision=22507
2007-02-22 Sven Neumann <sven@gimp.org>
* app/base/tile.[ch]: made tile_ref_count a static variable and
added a function to access it. Declared other (unused) global
counters as static variables and moved them into #ifdefs.
* app/base/tile-swap.c: use the function instead of declaring
tile_ref_count as extern.
* app/base/tile-manager.c
* app/base/pixel-surround.c: cosmetics.
svn path=/trunk/; revision=21975
2006-09-21 Sven Neumann <neumann@jpk.com>
* app/base/tile-manager.c (read_pixel_data_1) (write_pixel_data_1):
use the same code on all platforms. The optimization for bytes == 4
was pointless anyway.
2006-09-07 Sven Neumann <sven@gimp.org>
* app/base/pixel-region.[ch]
* app/base/tile-manager.[ch]
* app/base/tile-swap.[ch]: removed code that tried to swap in
tiles asynchronously (but ended up calling up nothing).
2006-09-07 Sven Neumann <sven@gimp.org>
* app/base/tile-cache.c
* app/base/tile-manager.c
* app/base/tile-private.h
* app/base/tile.c: removed tile locking macros that were only used
for the threaded tile swapper.
2005-09-29 Sven Neumann <sven@gimp.org>
* app/base/tile-cache.c
* app/base/tile-manager.c
* app/base/tile-private.h
* app/base/tile-swap.c
* app/base/tile.c: keep the data size of a tile in the Tile struct
instead of recalculating it over and over again. Adds an overhead
of 4 bytes per tile but speeds up the tile cache significantly.
2005-05-09 Sven Neumann <sven@gimp.org>
* app/base/tile-manager.c: inline tile_manager_get_tile_num().
* app/display/gimpdisplayshell-render.c (render_image_tile_fault):
reverted one of the changes I did here earlier.
2005-04-27 Sven Neumann <sven@gimp.org>
* app/base/tile-manager.c (tile_manager_get_tile): removed
redundant check.
* app/display/gimpdisplayshell-render.c: don't access the next
tile if we are at the end of the render loop anyway.
2004-12-12 Michael Natterer <mitch@gimp.org>
* app/paint-funcs/paint-funcs.[ch]: added new function
copy_region_nocow() as a workaround for the fact that sharing
tiles with the projection is heavily broken.
* app/base/tile-manager.c (tile_invalidate): added a warning when
entering the code path that breaks badly.
* app/core/gimp-edit.[ch]: added gimp_edit_copy_visible(), using
the non-COW copying function above.
* app/widgets/gimphelp-ids.h: added GIMP_HELP_COPY_VISIBLE.
* app/actions/edit-actions.c
* app/actions/edit-commands.[ch]: added action & callback for
"edit-copy-visible".
* menus/image-menu.xml.in: added "edit-copy-visible" to the image
menu.
* tools/pdbgen/pdb/edit.pdb: added gimp_edit_copy_visible()
PDB wrapper.
* app/pdb/edit_cmds.c
* app/pdb/internal_procs.c
* libgimp/gimpedit_pdb.[ch]: regenerated.
* plug-ins/script-fu/scripts/copy-visible.scm: removed all code
and made it a backward compat wrapper around gimp-edit-copy-visible.
Fixes bug #138662.
2004-06-13 Sven Neumann <sven@gimp.org>
* app/paint-funcs/paint-funcs.c (shapeburst_region): don't call
tile_ewidth() three times from the inner loop.
* app/base/tile-manager.c (tile_manager_get): don't call
tile_size() twice on the same tile.
* app/base/tile-private.h: added tile_size_inline(), an inline
version of the tile_size() function.
* app/base/tile-cache.c
* app/base/tile-manager.c
* app/base/tile-swap.c
* app/base/tile.c: use tile_size_inline() from inside the tile
subsystem.