summaryrefslogtreecommitdiff
path: root/source/fitz/list-device.c
diff options
context:
space:
mode:
authorRobin Watts <Robin.Watts@artifex.com>2016-03-02 06:22:08 -0800
committerRobin Watts <Robin.Watts@artifex.com>2016-03-03 15:52:44 -0800
commit0176d811a7a84052aaa79c89b9c84c722c8ff23d (patch)
tree82261412e1d46008c0b93ec44f4640aaec6042df /source/fitz/list-device.c
parent5bf3cc532041bb545d32a26539dadab04e1dcd12 (diff)
downloadmupdf-0176d811a7a84052aaa79c89b9c84c722c8ff23d.tar.xz
Memento: Speed improvements.
Avoid searching the linked list of blocks in order to remove a block by moving to a doubly linked list. This can be done without increasing the amount of memory in use by making better use of the 'parent' pointer that is only used when displaying nested blocks. Also store magic values in the 'child' and 'sibling' pointers (again only used when displaying nested blocks) so that we can quickly verify that a block is real before doing too much with it. Those changes drastically reduce the time required for MEMENTO_LEAKONLY runs (now the same order of magnitude as non memento runs). Normal memento runs are still very slow when the numbers of blocks increase due to the paranoid checking taking time. To ameliorate this a bit, we try 2 other things. Firstly, we optimise the searching of blocks by making use of int aligned tests. This still doesn't make much difference. Secondly, we introduce a new mechanism for the 'paranoia' levels. If a negative number is given for the paranoia level (say -n) then we first perform our overwrite checks after n events. We next test after 2n events, then 4n, then 8n etc. The new default paranoia level is set to be -1024. This makes a huge difference, and brings normal memento runs down to be comparable with debug runs.
Diffstat (limited to 'source/fitz/list-device.c')
0 files changed, 0 insertions, 0 deletions