Über Open CoDE Software Wiki Diskussionen GitLab

Skip to content

improve xdf2 parser

Felix Bernhardt requested to merge lxml into main

Improved xdf2 Schema parser performance by 45% (4.6s to 2.6s for parsing BOB on my local machine) by:

  1. Not freeing memory for already processed nodes immediately
  2. 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.

Merge request reports