filter_model algorithm is not optimal from performance point of view.
createOrGetElement call should be avoided in that function and instead create new SElement with using its consructor and attach it directly to parent element created earlier. This changes processing a lot since searching from the root level is not done for every created element.