I have a HTML/JS website with several hundreds of div elements. A few dozens of these elements should be updated in a rapid fashion (up to 250 times per second) at one time
It seems like you already have the basics of what you want to do. For your particular use case, I see no reason why you shouldn't just naively implement those methods.
var imaginaryLibrary = function() {
var toProcess = [];
function collectDomUpdate(el, prop, newValue) {
toProcess.push([el, prop, newValue])
}
function applyUpdates() {
while (toProcess.length) {
var actions = toProcess.pop()
actions[0][actions[1]] = actions[2]
}
}
}
The above code is a skeleton of what you might want to do—it contains no error checking and assigns directly to object instead of potentially using DOM attributes.