Reputation: 292
Doing some testing on google script's ContactsApp and loading in contacts. It looks like it takes as much time to run ContactsApp.getContacts() (loading all contacts) as it does to run ContactsApp.getContact('email') (specific contact). About 14 seconds on each method for my contacts
My assumption is that both methods are calling all contacts and the 2nd only matches on email. This drags quite a bit.
Has anyone confirmed this and is there anyway to keep the loaded contacts in memory between pages (session variable?).
Upvotes: 2
Views: 364
Reputation: 2240
You've got a few options for storing per-user data:
It sounds like for your use case getPrivateCache() is your best option for user specific session-like data storage.
(Just make sure your intended use fits within the terms of service.)
Upvotes: 1