I decided to check whether fast-tags
is still fast and this is what I came up with: GitHub - random-random-stuff/haskell-tags-benchmark2024: Benchmark generation of tags from Haskell sources
My workflow is to download some common dependencies and index them together with my project so that names will be resolved in the dependencies as well. The dependencies are static and typically are indexed only once, but when they’re not cached the delay matters for me so I use fast-tags
.
The raw speed numbers that don’t include file collection are:
$ hasktags --ctags -o tags.hasktags STDIN +RTS -s <files.txt
...
Total time 8.831s ( 8.865s elapsed)
$ fast-tags -o tags.fasttags - +RTS -s -N <files.txt
...
Total time 10.805s ( 1.268s elapsed)
$ ghc-tags -c -o tags.ghctags +RTS -s <files.txt
...
Total time 30.259s ( 6.278s elapsed)
Overall fast-tags
seems to still be a fast one. NB it also indexes hsc, Alex and Happy files.
Regarding precision there were comparisons stating that hasktags collects the least information. The report was assumming that all tag generators generate the same output but that’s not the case: hasktags
generates Emacs-style tags by default, fast-tags
generates vim-style tags and ghc-tags
has no default and forces you to choose. Comparing size of Emacs-style tags against vim-style ones is not right. Different formats also take different time to generate.
I compared vim tags generation, of the three thet fast-tags
gives least amount of entities:
$ wc -l tags.*
154802 tags.fasttags
229023 tags.ghctags
230680 tags.hasktags
However hasktags
contains the least info. For intance it doesn’t output tag type by default (e.g. whether it’s constructor, function, type, etc), while the others do. Maybe I missed the option to enable it. Example output:
$ grep -F "Key'F14" tags.*
tags.fasttags:26086:Key'F14 all-packages/GLFW-b-3.3.9.0/Graphics/UI/GLFW/Types.hs 358;" C
tags.ghctags:41912:Key'F14 all-packages/GLFW-b-3.3.9.0/Graphics/UI/GLFW/Types.hs 358;" c term:Key'F14
tags.hasktags:47312:Key'F14 ./all-packages/GLFW-b-3.3.9.0/Graphics/UI/GLFW/Types.hs 358