in reply to Re^3: Fast Replacement (0.01 seconds)
in thread Fast Replacement
For what it's worth, depending on how I measure, this is at least ten times faster than my solution. In real life it would be quite a bit more than 10x the speed of my solution -- I just used Benchmark to test, and that required making a copy of the input string on each test iteration so as not to mess with the original. Since the OP wouldn't be making copies (hopefully), that could be factored out, and would make the difference between our two algorithms all the more significant.
Dave
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Fast Replacement (0.01 seconds)
by BrowserUk (Patriarch) on Jun 14, 2013 at 19:42 UTC | |
by davido (Cardinal) on Jun 14, 2013 at 21:16 UTC | |
by BrowserUk (Patriarch) on Jun 14, 2013 at 22:13 UTC | |
by davido (Cardinal) on Jun 14, 2013 at 22:21 UTC | |
by davido (Cardinal) on Jun 16, 2013 at 16:52 UTC | |
by BrowserUk (Patriarch) on Jun 16, 2013 at 18:39 UTC | |
by BrowserUk (Patriarch) on Jun 14, 2013 at 21:52 UTC |