Reddit hot ranking
Reddit's hot sort, in its released source, adds the log of a post's net votes to its posting time, so ten times the votes buys 12.5 hours of freshness.
Which post is hotterInteractive
- Votes term
- log10 of net votes
- Time unit
- 45,000 s = 12.5 hours
- 10× the votes equals
- 12.5 hours newer
- Clock starts
- 1134028003 (8 Dec 2005)
- Source
- reddit-archive, archived
The formula and equal steps
In words
The hot formula
4/4
In reddit's released source a post's score is upvotes minus downvotes 1. Hot takes log10 of that score's size 2, gives it the score's sign, and adds the seconds between the post's creation and a fixed moment in December 2005, divided by 45,000 34. 45,000 seconds is 12.5 hours, so a post 12.5 hours newer ties one with ten times the net votes. Compare Hacker News ranking, which divides by age instead.
4 of 4 quotes found in their sources
-
r2/lib/db/_sorts.pyx, reddit's released source (reddit-archive on GitHub) github.com
score(long ups, long downs): return ups - downs
Quote found in the source -
r2/lib/db/_sorts.pyx, reddit's released source (reddit-archive on GitHub) github.com
order = log10(max(abs(s), 1))
Quote found in the source -
r2/lib/db/_sorts.pyx, reddit's released source (reddit-archive on GitHub) github.com
seconds = date - 1134028003
Quote found in the source -
r2/lib/db/_sorts.pyx, reddit's released source (reddit-archive on GitHub) github.com
return round(sign * order + seconds / 45000, 7)
Quote found in the source
Why the log matters
3/3
Because of log10, going from 1 to 10 net votes adds as much as going from 100 to 1,000 1. A post with a net negative score gets a sign of minus one, so its votes pull it down 2. Hot never decays: a post keeps the number it has, and newer posts simply start higher, which is why old posts slide down the list 3.
3 of 3 quotes found in their sources
-
r2/lib/db/_sorts.pyx, reddit's released source (reddit-archive on GitHub) github.com
order = log10(max(abs(s), 1))
Quote found in the source -
r2/lib/db/_sorts.pyx, reddit's released source (reddit-archive on GitHub) github.com
elif s < 0: sign = -1
Quote found in the source -
r2/lib/db/_sorts.pyx, reddit's released source (reddit-archive on GitHub) github.com
return round(sign * order + seconds / 45000, 7)
Quote found in the source
Mixing subreddits, and today
3/3
When the code merged several subreddits into one list, it divided each post's hot by a factor taken from its subreddit's top post 12. This code is historical: the repository is archived and receives no updates 3, so it shows how hot worked when the code was released, not necessarily how reddit ranks today.
3 of 3 quotes found in their sources
-
r2/lib/normalized_hot.py, reddit's released source raw.githubusercontent.com
effective_hot = hot / hot_factor
Quote found in the source -
r2/lib/normalized_hot.py, reddit's released source raw.githubusercontent.com
Recalculate the item's hot score as if it had been submitted
Quote found in the source -
reddit-archive/reddit README raw.githubusercontent.com
This repository is archived and will not receive any updates
Quote found in the source