Vastly improve speed of _generic_link by making it iterative
Merge remote-tracking branch 'bitmap/slow-generic-link' into beta

* bitmap/slow-generic-link:
  Vastly improve speed of _generic_link by making it iterative