User:Jesse/NewFrecency: Difference between revisions

no edit summary
No edit summary
 
Line 1: Line 1:
https://bugzilla.mozilla.org/show_bug.cgi?id=704025
'''Frecency''' is a measure that combines frequency and recency.


== Problems with the current algorithm ==
This page describes a frecency measure based on exponential decay, and a way to store and update this measure efficiently.
 
== Problems with the old algorithm ==
https://developer.mozilla.org/en/The_Places_frecency_algorithm  
https://developer.mozilla.org/en/The_Places_frecency_algorithm  


Line 32: Line 34:
That takes care of the buckets and sampling. It could be implemented by storing the URL frecency score, and having an idle-daily job that multiplies all scores by (e ^ (-(ln 2) / 30)) = 0.977.
That takes care of the buckets and sampling. It could be implemented by storing the URL frecency score, and having an idle-daily job that multiplies all scores by (e ^ (-(ln 2) / 30)) = 0.977.


== Efficient computation ==
But with an additional trick, ''no recomputation is necessary''. The trick is to store in the database something with units of date.
But with an additional trick, ''no recomputation is necessary''. The trick is to store in the database something with units of date.


Line 52: Line 55:
* Doesn't emulate the "slowing decay" of the current bucket weights.
* Doesn't emulate the "slowing decay" of the current bucket weights.
** Could be emulated by having two exponential decays with different rates, if desired.
** Could be emulated by having two exponential decays with different rates, if desired.
== Implementation ==
* Gecko - HTTP cache: [https://hg.mozilla.org/mozilla-central/file/b40296602083/netwerk/cache2/CacheEntry.cpp#l1497 in CacheEntry::BackgroundOp]
* Firefox - URL history: Still uses the old algorithm ([https://bugzilla.mozilla.org/show_bug.cgi?id=704025 bug 704025])
Confirmed users
729

edits