codebytere / codebytere/node-mac-contacts
Slow performance with lots of contacts
- Vorherrschende Sprache
- Objective-C++
- Sterne
- 86
- Forks
- 18
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
Since my app was being very slow on their computer (MBP 16" 2019), I got a friend to run this:
```js
const nmc = require('node-mac-contacts')
console.time('done')
const c = nmc.getAllContacts(['contactImage', 'contactThumbnailImage', 'jobTitle', 'departmentName', 'organizationName', 'middleName', 'note', 'socialProfiles'])
console.log(c.length, 'contacts')
console.timeEnd('done')
```
It took 16s for ~4k contacts.
> 3705 contacts
> done: 16798.31201171875ms
Thought it might be the image buffers so asked them to run:
```js
console.time('done')
console.log(require('node-mac-contacts').getAllContacts().length, 'contacts')
console.timeEnd('done')
```
It still took 12s.
Any ideas on how to make it faster or debug this? I created 4k contacts with a first and last name on my Mac but it didn't slow it up much:
> 4135 contacts
> done: 319.488037109375ms
I'll use a worker and cache the results as a workaround. I'm curious why it takes so long.
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Rechercherichtung
Beginne damit, die gemeldeten getAllContacts-Benchmarks unter macOS mit und ohne die aufgeführten Kontaktfelder zu reproduzieren und dabei die Fälle mit 16 Sekunden und 319 ms zu vergleichen. Verfolge die Implementierung von node-mac-contacts, um zu ermitteln, warum sich ähnliche Kontaktanzahlen so stark unterscheiden; abgeschlossen ist die Aufgabe, wenn die Ursache verstanden ist und eine messbare Leistungsverbesserung oder eine klare Einschränkung dokumentiert ist.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- macos, node.js, objective-c
- Bereich
- desktop, performance
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 35/100