tvm
tvm copied to clipboard
[Relay] optimize dumpir time
trafficstars
Add string before doc, slow. Add string after doc, fast
Thanks for contributing to TVM! Please refer to guideline https://tvm.apache.org/docs/contribute/ for useful information and tips. After the pull request is submitted, please request code reviews from Reviewers by @ them in the pull request thread.
I tested that
Doc doc; for (int i = 0; i <= 100000; i++) { Doc a; a << "a"; doc = a << doc; };
and
Doc docc; for (int i = 0; i <= 100000; i++) { Doc a; a << "a"; docc = docc << a; }
First cost time is 150s
Second cost time is 1s
@Hzfengsy cc