mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-04 19:02:28 +00:00
core: add cachedDao to cache accounts and contracts
Importing 100K blocks starting at 1.4M, before this patch: real 6m0,356s user 8m52,293s sys 0m47,372s After this patch: real 4m17,748s user 6m23,316s sys 0m37,866s Almost 30% better.
This commit is contained in:
parent
212cf44e26
commit
0d0a27d271
4 changed files with 176 additions and 11 deletions
|
@ -19,12 +19,12 @@ type interopContext struct {
|
|||
trigger byte
|
||||
block *Block
|
||||
tx *transaction.Transaction
|
||||
dao *dao
|
||||
dao *cachedDao
|
||||
notifications []state.NotificationEvent
|
||||
}
|
||||
|
||||
func newInteropContext(trigger byte, bc Blockchainer, s storage.Store, block *Block, tx *transaction.Transaction) *interopContext {
|
||||
dao := newDao(s)
|
||||
dao := newCachedDao(s)
|
||||
nes := make([]state.NotificationEvent, 0)
|
||||
return &interopContext{bc, trigger, block, tx, dao, nes}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue