Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Header is not cached, lookups may take 3 seeks rather than claimed 2. #4

Closed
patrick-higgins opened this issue Jan 23, 2013 · 3 comments

Comments

@patrick-higgins
Copy link
Contributor

The 2kB header is not stored in cdb.Cdb, so find() calls c.readNums((h << 3) & 2047) on the first lookup after each call to FindStart(). If the OS cache was flushed, this could lead to 3 seeks rather than 2.

@jbarham
Copy link
Owner

jbarham commented Feb 7, 2013

Hmm, in practice ISTM that the header should be hot given that it's accessed on every read and therefore very unlikely to be flushed.

@patrick-higgins
Copy link
Contributor Author

Yeah, I guess just because you store something in your program's memory, it might get swapped and result in 3 seeks, too. Anyway, caching the header would also reduce the number of byte to integer conversions, though compared to a seek these may not be worth worrying about.

@jbarham
Copy link
Owner

jbarham commented Feb 8, 2013

Integer conversions are negligible compared to disk I/O so I'll leave it as is for now.

@jbarham jbarham closed this as completed Feb 8, 2013
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

No branches or pull requests

2 participants