Skip to content

Page eviction#1

Open
KevinPike wants to merge 10 commits intomasterfrom
page-eviction
Open

Page eviction#1
KevinPike wants to merge 10 commits intomasterfrom
page-eviction

Conversation

@KevinPike
Copy link
Copy Markdown
Contributor

This is a work in progress stab at implementing page eviction. It includes an implementation of LRU, SLRU, and ARC (not sure if there is a problem using this with IBM patent). The cache hit/miss ratio is printed at the end of the benchmark.

Cache hit rates at different sizes of 10, 100, 500, 1000:
Noop: 0.60273975
LRU: 0.01743462, 0.01743462, 0.087173104, 0.08966376
SLRU: 0.04856787, 0.30635118, 0.29638854, 0.57907844
ARC: 0.19551681, 0.19551681, 0.42216688, 0.60273975

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, not sure how this got into this file.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, in Java it's generally preferred to keep one class pr file... the exception are inner classes such as in Variant (though that one is starting to feel messy).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I will separate them out!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Am I missunderstanding something - how will you ever get a new page in, when you exit if it's not already in?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question. Currently the PageCache implementations don't add objects to the pageMap, they only evict them since trimPageSet is called before objects are added to pageMap. Should we set pages in the cache? Or trimPageSet before returning the page?

@kasperjj
Copy link
Copy Markdown
Contributor

Put all classes in separate files! It probably makes sense for us to move everything related to paging into a separate package... so, let's make a new folder under pikadb called page that has Page, PageDiff, PageFile and your files related to the page strategy!

@KevinPike
Copy link
Copy Markdown
Contributor Author

Should WriteAheadLog and Column move into the page package too? How do you suggest handling these files when creating the page package? I tried to create the page package but ran into a couple dependencies being in the current main package that would create a circular dependency.

@KevinPike KevinPike changed the title [WIP] Page eviction Page eviction Oct 10, 2015
@KevinPike
Copy link
Copy Markdown
Contributor Author

@kasperjj I removed ARC and created the page package

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants