Instead of creating a new array per visited node, use .NET's built-in System.Buffers.ArrayPool.
At the start of the node visit, rent an array from the pool that matches parametersCount.
Copy the parameters into it.
Pass it to the visitor.
Immediately after the visitor returns, return the array to the pool.
Instead of creating a new array per visited node, use .NET's built-in System.Buffers.ArrayPool.
At the start of the node visit, rent an array from the pool that matches parametersCount.
Copy the parameters into it.
Pass it to the visitor.
Immediately after the visitor returns, return the array to the pool.