8000 perf(core): Introduce mutable map struct by harshil-goel · Pull Request #9199 · hypermodeinc/dgraph · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

perf(core): Introduce mutable map struct #9199

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

Merged
merged 10 commits into from
Dec 6, 2024
Merged

Conversation

harshil-goel
Copy link
Contributor
@harshil-goel harshil-goel commented Oct 16, 2024

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.

@harshil-goel harshil-goel requested a review from a team October 16, 2024 13:56
@github-actions github-actions bot added area/testing Testing related issues area/core internal mechanisms go Pull requests that update Go code labels Oct 16, 2024
@harshil-goel harshil-goel force-pushed the harshil-goel/mutable-map branch 2 times, most recently from 6fdd230 to 2f48d14 Compare October 21, 2024 18:53
@harshil-goel harshil-goel changed the title perf(core): Introduce mutable map struct to update mutation map in Li… perf(core): Introduce mutable map struct Oct 23, 2024
@harshil-goel harshil-goel force-pushed the harshil-goel/mutable-map branch 2 times, most recently from 8497e3d to 34d455d Compare November 1, 2024 21:18
shivaji-kharse
shivaji-kharse previously approved these changes Nov 5, 2024
@harshil-goel harshil-goel force-pushed the harshil-goel/mutable-map branch 3 times, most recently from 00ba427 to 3332561 Compare December 3, 2024 13:09
@harshil-goel harshil-goel force-pushed the harshil-goel/mutable-map branch from 24d9a43 to a8fa85e Compare December 5, 2024 13:19
// We choose to write the PL at r.startTs, so it won't be read by txns,
// which occurred before this schema mutation.
e := &badger.Entry{
Key: kv.Key,
Value: kv.Value,
UserMeta: BitCompletePosting,
}

if len(kv.Value) == 0 {
Copy link
Member

Choose a reason for hiding this comment

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

we should just update the UserMeta in the if condition for clarity

@@ -1024,17 +1019,22 @@ func (r *rebuilder) Run(ctx context.Context) error {
if err := proto.Unmarshal(slice, kv); err != nil {
return err
}
if len(kv.Value) == 0 {
Copy link
Member

Choose a reason for hiding this comment

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

just make sure that we do not get into this case frequently for index keys

@mangalaman93 mangalaman93 merged commit 889008f into main Dec 6, 2024
14 checks passed
@mangalaman93 mangalaman93 deleted the harshil-goel/mutable-map branch December 6, 2024 04:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/core internal mechanisms area/testing Testing related issues go Pull requests that update Go code
Development

Successfully merging this pull request may close these issues.

4 participants
0