Commit aad8e09f authored by Adam Izraelevitz's avatar Adam Izraelevitz Committed by GitHub
Browse files

Rewrote inline xform to fix quadratic perf. bug (#377)

* Rewrote inline xform to fix quadratic perf. bug

Turns out caching previously inlined modules is not useful

The previous algorithm in a module, would flatten an instance's children, then
flatten that instance. This caused all instances to be effectively
inlined the number of times of its depth in the instance hierarchy,
making it O(n*d*s), where n is the number of instances, and d is the depth
of the instance, and s is the number of statements in the instance.

The new algorithm directly inlines a module by keeping track of the
parents of that instance, making it constant time with the number of
instantiated instances.

* Minor style fixes
parent 4b346ea0
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment