You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using a physical android device (Node 9) to test. The NS version is 6.2.1.
When I load the contacts it takes over 30 seconds to load 827 contacts. Is this normal? Is there a way to speed things up?
Here is my code:
function getContacts() {
//get the contacts
console.log('start', new Date());
var contactFields = ["name", "phoneNumbers"];
contacts.getAllContacts(contactFields).then(
function (args) {
console.log('end', new Date());
},
function (err) {
console.log("Error: " + err);
}
);
}
@dpdragnev I found that converting photos to and from base64 string to allow transfer of data between worker and main thread is the main time consuming issue. By excluding the photo from the contactFields (and rather get that later, per contact) is much faster.
I think this is a limitation of the nativescript and workers, that all data has to be serializable to transfer between worker and main thread.
I see that you're not providing photo in your example code, but that's what I changed.
Activity
fpaaske commentedon May 10, 2020
We're experiencing the same issue;
Read 200 contacts on iPhone 8 takes 200 ms.
Read 50 contacts on S6 takes around 6 seconds.
Read 50 contacts on Pixel 3 takes around 2 seconds.
fpaaske commentedon Aug 26, 2020
@dpdragnev I found that converting photos to and from base64 string to allow transfer of data between worker and main thread is the main time consuming issue. By excluding the photo from the
contactFields(and rather get that later, per contact) is much faster.I think this is a limitation of the nativescript and workers, that all data has to be serializable to transfer between worker and main thread.
I see that you're not providing photo in your example code, but that's what I changed.
triniwiz commentedon Apr 23, 2021
@fpaaske I have a couple Ideas how android can be improved