Akavache icon indicating copy to clipboard operation
Akavache copied to clipboard

[BUG] 6.10.20 GetAllObjects function is extremely slow

Open EmilAlipiev opened this issue 5 years ago • 12 comments

Describe the bug I have created this bug earlier and came back to see any improvement because my previous issue was closed with a commit but unfortunately result is same or worse.

I am currently on 6.0.31 which is extremely efficient and fast. I have a complex data structure with 3-4 layer parent children. You can think of like School->Class->Teacher->Students i store each under school object. When I try to pull cached school objects with await BlobCache.UserAccount.GetAllObjects<School>();, tested for 300 records, it returns within 2 secs in 6.0.31 but latest version 6.10.20 takes 11 secs.

There must be major breaking change in between those version 6.2.3 had same issue. https://github.com/reactiveui/Akavache/issues/451

Is there any stress test available here? If not later i will try to create a repro or try to debug the source code myself.

Environment

  • OS: android 10
  • Device: UWP local and Android emulator or device
  • Version: 6.10.20
  • Working Version: 6.0.31

Repro:

ListViewXamarin.zip

EmilAlipiev avatar Jun 28 '20 02:06 EmilAlipiev

Hey @EmilAlipiev :wave:,

Thank you for opening an issue. We will get back to you as soon as we can. Also, check out our Open Collective and consider contributing financially.

https://opencollective.com/reactiveui

PS.: We offer priority support for all financial contributors. Don't forget to add priority label once you start contributing :smile:

An advanced, composable, functional reactive model-view-viewmodel framework for all .NET platforms!

+1 - Been having the same issue

leemallon avatar Jul 10 '20 20:07 leemallon

@rarelyleemallon do you have sample project? i have to create one but being so busy recently. If you have one, it would help for solution faster i think.

EmilAlipiev avatar Jul 10 '20 21:07 EmilAlipiev

Repro would definitely help out a lot with getting this one fixed sooner.

glennawatson avatar Jul 16 '20 00:07 glennawatson

please find the repro. Steps to follow very simple. see the screenshot. There 2 type of json file in the attached project. Simple and complex(nested objects). Buttons are self explanatory. Enter object count to enter. the more you enter it becomes slower. Below are the some results and comprehension between latest and 6.0.31 versions

image

300 simple json object - save, read, deleteall

latest version image

6.0.31 image

600 nested complex json object - save, read, deleteall

latest version image 6.0.31 image

300 nested complex json object - save, read, deleteall

latest image

6.0.31 image

600 nested complex json object - save, read, deleteall latest image 6.0.31 image

As you can the more number increases, complex objects are slower

EmilAlipiev avatar Aug 03 '20 00:08 EmilAlipiev

Any chance for the source

glennawatson avatar Aug 03 '20 00:08 glennawatson

sorry posted too fast. I have updated original question above with the source code. Above screenshots are for UWP and i think android even has bigger difference. Ios i havent tested yet.

EmilAlipiev avatar Aug 03 '20 01:08 EmilAlipiev

@glennawatson FYI, above source code has 6.0.31 as last i tested with it.

EmilAlipiev avatar Aug 03 '20 01:08 EmilAlipiev

I have just tested 7.2.1 and problem still persists. it is still very slow.

EmilAlipiev avatar Feb 03 '21 22:02 EmilAlipiev

Just coming back to this issue. Today tested version 8.1.1 and problem seems to be resolved, at least on Android so far. I will test further to see if it works on all. thanks for the progress :)

EmilAlipiev avatar Feb 15 '22 15:02 EmilAlipiev

unfortunately problem is not solved only working well on Android 12 but I have just tested with another phone with Android 9, it is somehow slow

EmilAlipiev avatar Mar 15 '22 17:03 EmilAlipiev

I have made more tests to understand the behaviour and testing with same data Android 9 device with Akavache 8.1.1 returns 14 secs Android 9 Akavache 6.10.20 returns 4 secs

Android 12 version 8.1.1 returns 4 secs Android 12 Akavache 6.10.20 returns 4 secs

What could be the reason on the old Android version Akavache latest version is extremely slow?

EmilAlipiev avatar Mar 18 '22 16:03 EmilAlipiev