I have speed up updating the model by just deleting the whole model and rebuilding it which is way faster than looking for changes (O(n), was O(n²) before). Now updating a symbol table with 1k variables takes 6ms (780ms before) and 10k variables takes 66ms.