10
0
mirror of https://github.com/LCPQ/QUESTDB_website.git synced 2024-11-04 13:13:55 +01:00

Performance improvement

This commit is contained in:
Mickaël Véril 2020-08-24 12:35:05 +02:00
parent 62acffa870
commit a44813e2d1

View File

@ -211,9 +211,14 @@ draft: false
var selects = getAllSelectBefore(name, true) var selects = getAllSelectBefore(name, true)
var currentselect = selects.last() var currentselect = selects.last()
selects = selects.slice(0, selects.length - 1) selects = selects.slice(0, selects.length - 1)
var AllValsCache = new Map()
selects.each(function() {
AllValsCache.set(this.name,getAllVals(this))
})
var AAllValsCache = Array.from(AllValsCache)
var vals = uniq(window.dats.filter(d => { var vals = uniq(window.dats.filter(d => {
return Array.from(selects).every((el) => { return AAllValsCache.every(([k,v]) => {
return getAllVals(el).includes(getSelectValue(d, el.name)) return v.indexOf(getSelectValue(d, k)) !== -1
}) })
}).map((d) => getSelectValue(d, name))) }).map((d) => getSelectValue(d, name)))
const publis = await (async () => { const publis = await (async () => {