line = (' '):rep(50000):match'([^\n]*)\n' takes > 20 seconds on my PC. Adding a start-anchor:
line = (' '):rep(50000):match'([^\n]*)\n'