Performance of this deep equal implementation is generally proportionally between 5x slower and 700x slower compared to native deepStrictEqual
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- javascript, node.js
- Ambito
- performance
Direzione di ricerca
Inizia con il benchmark in src/tests/self.ts intorno alle righe 324-386 e riproduci il confronto con il deepStrictEqual nativo. Esegui il profiling dell’implementazione di deep-equal con i casi di array e oggetto segnalati, quindi verifica qualsiasi variazione delle prestazioni con lo stesso benchmark e conferma che la correttezza rimanga invariata.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
I have a test implemented here using my test/benchmark library. I've also taken the plot that this generates and hosted it publicly on the net here: https://unphased.github.io/static-sharing/2024-03-29/deepequal_perf/deepequal_perf_collisions.html
I like this method of sharing benchmark results in HTML format since the plot made with uplot allows for interacting with series and zooming in.
The general summary based on the above plotting is that although this deep-equal implementation does not have an asymptotic algorithmic shortcoming compared to the builtin (as demonstrated by the straight lines in the first plot), it is consistently between 5x slower (if I compare large arrays filled with integers) and 700x (!!) slower (if I compare large arrays filled with objects). Obviously being implemented in js as opposed to presumably C++ will necessitate a 2-10x performance hit, something seems suboptimal here because this is a lot slower than that.
I first became aware of the issue being in this library by seeing it show up in the chrome profiler. I haven't reviewed the code yet, but based on the flamegraph that I saw, the implementation appears to be a recursive one. And that doesn't bode well for performance, but I would expect even a recursive implementation to be faster than what I'm seeing.
Please let me know if any of this is unclear.
- Lingua principale
- JavaScript
- Stelle
- 792
- Fork
- 107
- Merge medio
- 9g 20h
- PR unite (30g)
- 1
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di inspect-js/node-deep-equal
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
inspect-js/node-deep-equal#112 ·
-
breaking change in node 23Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
inspect-js/node-deep-equal#110 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 25/100
inspect-js/node-deep-equal#108 · 5 commenti ·
-
Dependency DashboardAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 15/100
Tutte le issue di inspect-js/node-deep-equal
Issue simili
-
ai core enhancement good first issue testing
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
cli: `studio --request <missing file>` answers with a raw ENOENT/EISDIR instead of a clear errorForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertabug good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
laaielichter/Ai-edit-studio#81 ·
I maintainer di solito rispondono entro 1 giorno