datatable.refresh() takes more than 10x as long to run than rebuilding the table from scratch
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
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- javascript
- Ambito
- frontend, performance
Direzione di ricerca
Riproduci il confronto dei tempi nel metodo renderDatatable fornito usando la costruzione di DataTable e refresh(), con la funzione di formattazione delle colonne abilitata e disabilitata. Usa il profiling del browser intorno al callback di formattazione e al percorso di refresh per identificare la causa del rallentamento; il lavoro è completato quando la discrepanza è spiegata e viene identificata una soluzione affidabile o una limitazione documentata.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
The following output was collected from datatable v1.14, but I get similar output for 1.15.3
renderDatatable(data=null) {
console.time('rendertable');
// display the table
this.form.set_df_property(this.formAttr.section, 'hidden', false);
this.form.fields_dict[this.formAttr.section].collapse(false);
// set up the field to receive the datatable
this.form.get_field(this.formAttr.field).html(`
<div id='${this.formAttr.sel.substring(1)}'></div>
`);
// render the datatable
this.table = new DataTable(this.formAttr.sel, {
...this.datatableOptions,
columns : this.columns,
data : data || this.data.tableData,
});
console.timeEnd('rendertable');
console.time('REFRESH');
this.table.refresh();
console.timeEnd('REFRESH');
}
Rendering the table with two rows:
rendertable: 60.090087890625 ms
REFRESH: 666.958984375 ms
60ms seems reasonable to create a table with two rows. Note that I have a format function that runs on most columns. 667ms refresh is an over 10x as slow though. What could be causing the slowdown?
There are inconsistencies, although no practice workarounds that I have discovered aside from re-creating the table from scratch.
This is quite interesting: when I profile my cell format method, the initial table render takes longer (expected, since I'm writing to the log), but the refresh no longer takes extra time to run. Note that I am unable to replicate the speedup in the refresh method by simply forcing the format function to take longer; it only appears to respond to console.time():
formatting: 0.02001953125 ms
formatting: 0.01904296875 ms
formatting: 0.004150390625 ms
formatting: 0.005126953125 ms
formatting: 0.004150390625 ms
formatting: 0.00390625 ms
formatting: 0.003173828125 ms
formatting: 0.00390625 ms
formatting: 0.002685546875 ms
formatting: 0.004150390625 ms
formatting: 0.0087890625 ms
formatting: 0.003662109375 ms
formatting: 0.004150390625 ms
formatting: 0.004150390625 ms
formatting: 0.00390625 ms
formatting: 0.004150390625 ms
formatting: 0.01513671875 ms
formatting: 0.007080078125 ms
formatting: 0.004150390625 ms
formatting: 0.003173828125 ms
formatting: 0.003173828125 ms
formatting: 0.003173828125 ms
formatting: 0.0029296875 ms
formatting: 0.0048828125 ms
formatting: 0.0029296875 ms
formatting: 0.00390625 ms
formatting: 0.001953125 ms
formatting: 0.001708984375 ms
formatting: 0.0029296875 ms
formatting: 0.003173828125 ms
formatting: 0.004150390625 ms
formatting: 0.004150390625 ms
formatting: 0.003173828125 ms
formatting: 0.0048828125 ms
rendertable: 364.31201171875 ms
formatting: 0.005859375 ms
formatting: 0.00390625 ms
formatting: 0.0029296875 ms
formatting: 0.007080078125 ms
formatting: 0.003173828125 ms
formatting: 0.002685546875 ms
formatting: 0.00390625 ms
formatting: 0.0029296875 ms
formatting: 0.003173828125 ms
formatting: 0.003173828125 ms
formatting: 0.0029296875 ms
formatting: 0.0029296875 ms
formatting: 0.003173828125 ms
formatting: 0.003173828125 ms
formatting: 0.002685546875 ms
formatting: 0.0029296875 ms
formatting: 0.0029296875 ms
formatting: 0.002685546875 ms
formatting: 0.003173828125 ms
formatting: 0.003173828125 ms
formatting: 0.0029296875 ms
formatting: 0.003173828125 ms
formatting: 0.001953125 ms
formatting: 0.0029296875 ms
formatting: 0.001953125 ms
formatting: 0.0029296875 ms
formatting: 0.003173828125 ms
formatting: 0.001708984375 ms
formatting: 0.003173828125 ms
formatting: 0.002197265625 ms
formatting: 0.004150390625 ms
formatting: 0.001953125 ms
formatting: 0.0029296875 ms
formatting: 0.0029296875 ms
REFRESH: 383.912109375 ms
What's going on here?
- Lingua principale
- JavaScript
- Stelle
- 1.3k
- Fork
- 223
- Merge medio
- 23h 14m
- PR unite (30g)
- 1
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
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 frappe/datatable
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Datatable stops responding to clicks after selecting across collapsed or scrolled-out rowsForse già presa @RaphaelFakhri l’ha presa 25 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
-
Bug with serialNoColumn= falseForse già presa @Valley-15 l’ha presa 295 giorni fa. Aperta
Difficoltà 1/5 1-3 ore Idoneità per principianti 68/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
Tutte le issue di frappe/datatable
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 66/100
I maintainer di solito rispondono entro 1 giorno
-
Edit: Tele1 Logo [SV]Apertacheck:passed logos:edit
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
db-d1-sqlite: upsert is aliased to updateOne, so payload.kv.set never inserts new keysForse già presa @pcbeingused333 l’ha presa oggi. ApertaBug db: d1-sqlite Payload OSS
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
payloadcms/payload#19766 ·
I maintainer di solito rispondono entro 1 giorno
-
Type: Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
inverse-inc/packetfence#9707 ·
I maintainer di solito rispondono entro 1 giorno
-
feedback simulation workshop
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
githubnext/gh-aw-workshop#5896 ·
I maintainer di solito rispondono entro 1 giorno