Is the user's reputation calculated (1) by calculating all the upvotes and downvotes he received since he signed up, every time the page is refreshed or (2) is the user's reputation a number which is stored and when ever the user's gets a new upvote or downvote then the reputation number is updated?
This is roughly how I believe it works:
When an action is saved to the database that involves a reputation change, the userid is kept for later processing and the reputation change is send over the websocket (assuming the user is logged in/active). At a regular interval a batch process runs that will go over the userid's that have reputation changes and apply those changes in the user reputation history. Either this same batch process or yet another one will consolidate reputation history events. This explains why you sometime see up/down votes for the same post appear on multiple lines in your reputation history. A day later all those events are combined per post.
If you want an actual overview of what your reputation history looks like goto /reputation on any site. It bypasses any caching and serves you what is in the database stored for your reputation.