-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
perf(core): Introduce mutable map struct #9199
base: main
Are you sure you want to change the base?
Conversation
6fdd230
to
2f48d14
Compare
posting/list.go
Outdated
|
||
mm.curTime = ts | ||
mm.curList = pl | ||
mm.uidMap = nil |
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.
mm.uidMap.clear()?
posting/list.go
Outdated
} | ||
|
||
for ts, pl := range mm.oldList { | ||
if mm.curTime != 0 && ts > mm.curTime { |
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.
I don't think we need this. We should just merge with the below if
posting/list.go
Outdated
mm.length = 0 | ||
} | ||
if mpost.Op == Del { | ||
mm.length -= 1 |
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.
what if there is only deleteAll and nothing else? Can the length be -1 then?
ad64584
to
8497e3d
Compare
8497e3d
to
34d455d
Compare
Currently the delta postings are being stored inside a map. When we are using cache, these deltas gets unnecessarily copied again and again because of the limitations of map. We have introduced a new struct, that would allow us to work on the list of
deltas.
With the introduction of this, we can now without copying the map, can pass around lists from one transaction to another without issue.
We are also going to store results like delete markers, uid to posting map and other stuff required to make queries go faster.