This speeds up the LLD test suite on Windows by 3x. Most of the time is
spent on lld/test/ELF/linkerscript/diagnostics.s, which repeatedly
constructs linker scripts with appending echo commands.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
Looks pretty good... just a few nits and one suggestion.
llvm/utils/lit/lit/TestRunner.py | ||
---|---|---|
7 ↗ | (On Diff #105546) | Minor nit: you should usually have access to cStringIO, which might be faster. The common pattern to use it goes like this: try: import cStringIO as StringIO except ImportError: import StringIO |
245 ↗ | (On Diff #105546) | Would it make sense to use while instead of if? (That would handle the case of 'echo -e -n blah'). |
262 ↗ | (On Diff #105546) | (Syntax nit) It looks like args will always be a list, even if it's 0-length, right? You can omit the if-check in that case (for-loop over an empty list is effectively a no-op). |
421 ↗ | (On Diff #105546) | (Minor nit) For consistency, you might want to drop the outer parens. (Or leave them, I just wanted to double-check.) |
llvm/utils/lit/lit/TestRunner.py | ||
---|---|---|
7 ↗ | (On Diff #105546) | Done. It's kind of a micro-optimization, so I wasn't sure if it was worth it. |
262 ↗ | (On Diff #105546) | I need to check this for stdout.write(maybeUnescape(args[-1])), though. It seemed simpler to put the for loop inside the conditional as well. |
421 ↗ | (On Diff #105546) | Oops, this was a two-line conditional that got shortened. |