-
Notifications
You must be signed in to change notification settings - Fork 168
Cache for tables that are reused frequently #1074
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
Conversation
| case byronBlockRaw blk of | ||
| Byron.ABOBBlock ablk -> insertABlock tracer cache firstBlockOfEpoch ablk details | ||
| Byron.ABOBBoundary abblk -> insertABOBBoundary tracer cache abblk details | ||
| -- Serializiing things during syncing can drastically slow down full sync |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| -- Serializiing things during syncing can drastically slow down full sync | |
| -- Serializing things during syncing can drastically slow down full sync |
|
|
||
| import qualified Cardano.Db as DB | ||
|
|
||
| import Cardano.DbSync.Cache |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| import Cardano.DbSync.Cache | |
| import Cardano.DbSync.Cache (Cache(..), uninitiatedCache) |
| SyncLagging -> 2000 | ||
|
|
||
| rightToJust (Right a) = Just a | ||
| rightToJust _ = Nothing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a version of this in https://hackage.haskell.org/package/either that's already floating around in package deps somewhere.
| Origin -> DB.queryGenesis | ||
| At blk -> DB.queryBlockId (SBS.fromShort . getOneEraHash $ blockPointHash blk) | ||
| Origin -> | ||
| fmap (, Nothing) <$> DB.queryGenesis |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| fmap (, Nothing) <$> DB.queryGenesis | |
| (, Nothing) <<$>> DB.queryGenesis |
I think there is fmap . fmap defined in Protolude as <<$>>
|
What kind of speedup and memory usage are you seeing before / after this change? |
On benchmarks I've seen some pretty good speedup by caching multiassets #1067 |
|
Superceeded by PR #1094 . |
Supersedes #1067