metaborg/strategoxt — pull request #12 by Virtlink (2014-12-02 16:37:12+00:00)
Title: Implemented `concat` in Java for optimization

This Java implementation is on average 33% faster than the Stratego implementation on 100000 applications of `concat` on a large nested array. Additionally it severely reduces the chances of a `StackOverflowError` due to its iterative implementation.

This implementation preserves the annotations on the outer list. For example:

[[1, 2]{"12"}, [3, 4]{"34"}]{"outer"}
// [1, 2, 3, 4]{"outer"}

Note that the Stratego implementation treats annotations differently. However, I strongly suspect no code depends on this behavior, which is why I corrected it in the Java implementation:

[[1, 2]{"12"}, [3, 4]{"34"}]{"outer"}
// [1, 2, 3, 4]{"12"}