minetest/minetest — pull request #1992 by kaeza (2014-12-19 03:05:14+00:00)
Title: Faster string.split implementation.

Changes the implementation of `string.split` from pattern matching to substring finding.

Timing/test suite script can be found [here](https://gist.github.com/kaeza/e6e0b84aef2980200153) (`string_split_1` is Minetest's implementation, `string_split_2` is new implementation).

Test results can be found [here](https://gist.github.com/kaeza/5765a2d73b9aab1f12aa) (ran under LuaJit; I'd expect gains from stock Lua to be a bit bigger).

This does not intend to bring outright 3x performance improvement to Minetest itself, but can have a big effect on mods that make heavy use of `string.split`, and removes a possible Denial of Service attack with long strings, as shown in the timing results for `string_split_1 long`.

In any case, a little improvement.