#934·hydra

[Bug] tab completion slow with slow imports

Author: greaberCreated Sep 1, 2020Updated Sep 11, 2026
Labelsquestion

Bug

Description

Bash tab completion is slow for me (over two seconds even with a trivial config and a moderately complex config adds another 600ms). It seems that the reason is that it is loading my whole script, and some imports are slow.

Checklist

  • [ x] I checked on the latest version of Hydra
  • [ x] I created a minimal repro

To reproduce

** Minimal Code/Config snippet to reproduce **

import hydra
import torch


@hydra.main(config_path="conf", config_name="config")
def main():
    pass

if __name__ == '__main__':
    main()

import torch here is just an example of a slow import.

System information

  • Hydra Version : 1.0.0rc2
  • Python version : 3.7.6
  • Virtual environment type and version : conda 4.8.2
  • Operating system : Ubuntu 18.04

I'm running on a fast machine with ssd, no NFS or anything.