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

Questionable PutSync performance #183

Closed
fedoranimus opened this issue May 19, 2016 · 4 comments · Fixed by #227
Closed

Questionable PutSync performance #183

fedoranimus opened this issue May 19, 2016 · 4 comments · Fixed by #227

Comments

@fedoranimus
Copy link

What are expectations for performance when adding new items to a store via PutSync() as opposed to updating existing items in a store via PutSync()?

I've noticed a significant difference between the two, demonstrated by the following trivial code:

let testStore = new MemoryStore<any>({});
console.time("addingData");
for (let i = 0; i < 100000; i++) {
    testStore.putSync({id: i, value: i});
}
console.timeEnd("addingData");
console.time("puttingData");
for (let i = 0; i < 100000; i++) {
     testStore.putSync({ id: i, value: i });
}
console.timeEnd("puttingData");

The following times are returned:

addingData: 430.055ms (~.5s)
puttingData: 257644.077ms (~4.3min)

Is such a significant difference expected?

@dylans
Copy link

dylans commented May 25, 2016

That certainly does not look ideal at all. I'm wondering if 196cf08 is at all related, or if the type of fix made there needs to be applied elsewhere...

@rgillan
Copy link

rgillan commented Jul 1, 2019

I know it's a number of years but has anyone looked at this? We're seeing similar update performance with our production application (dStore/dGrid) where there's around a ~2-3s update per record on a largish Memory store (~30k records) and it's causing all sorts of grief (initial load is fine). Thanks as always, Rob

@rgillan
Copy link

rgillan commented Jul 3, 2019

So with further testing, it's not the dStore putSync in our case. It's somewhere downstream in the chain (trackable memory store into dGrid). Just the putSync process is averaging 0.02-0.03mS per overwrite/update). I'll update our findings here in case it's helpful.

@rgillan
Copy link

rgillan commented Jul 10, 2019

just to update with our findings. Turns out it was the individual events triggering the trackable capability of the dGrid. Our data is highly fluid, with some cases sustaining 100-150 changes per second. The dStore is happily updating; we've just set a more manual update of the dGrid collection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants