improve xdf2 parser
Improved xdf2 Schema parser performance by 45% (4.6s to 2.6s for parsing BOB on my local machine) by:
- Not freeing memory for already processed nodes immediately
- Optimizing the creation of generic types
Regarding 2.
a: list[str] = list()
b = list[str]()
Both variants create an empty list and communicate the full type of the list.
However, the second variant evaluates list[str]
every time the line is called, whereas the first line
ignores the type annotation when creating the list.
The first option is therefore faster when many generic types are created.