hcs42/vim-erlang-tags — pull request #2 by aerosol (2013-06-04 22:45:20+00:00)
Title: Speed up tag generation

Hey,

Measures taken in R15B02 root directory:

```
0:41:23 /opt/r15b02
❯ time ./vim-erlang-tags
./vim-erlang-tags 160.96s user 3.16s system 99% cpu 2:45.30 total

❯ time ./vim-erlang-tags-new
./vim-erlang-tags-new 5.56s user 0.97s system 96% cpu 6.744 total
```

Performance fixes (LOLSPEED [tm]):

- Set escript to run in compiled mode
- Introduce precompiled regexes
- Use iolists/binaries instead of "strings"
- Scan files with multiline regexes instead
of sequential line-by-line reads

Various minor fixes:

- Improve function detection regex
- Change ETS table structure, so even more actual tags
are now detected
- Replace ets:foldl dump with sort and tab2list combo
(seems tenderly faster on my machine)