DocShell/Fastback: Difference between revisions

no edit summary
No edit summary
Line 21: Line 21:


This algorithm is inefficient (O(n²)) in the worst case, but O(n) in the common case, since we'll rarely need to evict more than one viewer -- only if the user manually changes the pref that controls the limit.  There is a fast path for "clear history" which evicts all cached viewers in O(n) time.
This algorithm is inefficient (O(n²)) in the worst case, but O(n) in the common case, since we'll rarely need to evict more than one viewer -- only if the user manually changes the pref that controls the limit.  There is a fast path for "clear history" which evicts all cached viewers in O(n) time.
The global limit can be overridden with the <code>browser.sessionhistory.max_total_viewers</code> pref.  The default value of -1 computes a limit based on physical memory as described above.  Any other value acts as the global limit, with 0 disabling caching entirely.  The per-SHistory limit is defined by the <code>gHistoryMaxViewers</code> constant.
53

edits