Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reuse 4 is slow #1033

Open
nijel opened this issue Jul 4, 2024 · 2 comments · May be fixed by #1047
Open

Reuse 4 is slow #1033

nijel opened this issue Jul 4, 2024 · 2 comments · May be fixed by #1047
Labels
enhancement New feature or request regression Regression, something worked before, but not any more

Comments

@nijel
Copy link

nijel commented Jul 4, 2024

Reuse 4.0.2 takes 8 seconds to start without any parameters, just to show help. Reuse 3.0.2 takes 0.2 second.

This is caused by scanning for REUSE.toml in all subdirectories:

@classmethod
def find_reuse_tomls(cls, path: StrPath) -> Generator[Path, None, None]:
"""Find all REUSE.toml files in *path*."""
return Path(path).rglob("**/REUSE.toml")

So this goes through all subdirectories including virtual environments, build caches and whatever else might appear in the current directory.

Reuse 4.0.2:

$ time reuse 
použití: reuse [-h] [--debug] [--suppress-deprecation] [--include-submodules] [--include-meson-subprojects] [--no-multiprocessing] [--root PATH] [--version]
               {annotate,download,lint,spdx,supported-licenses,supported-licences,convert-dep5} ...

reuse je nástrojem pro dodržování doporučení REUSE. Další informace naleznete
na adrese <https://reuse.software/> a online dokumentaci na adrese
<https://reuse.readthedocs.io/>.

Tato verze reuse je kompatibilní s verzí 3.2 specifikace REUSE.

Podpořte činnost FSFE:

  Dary jsou pro naši sílu a nezávislost zásadní. Umožňují nám pokračovat v
  práci pro svobodný software všude tam, kde je to nutné. Zvažte prosím
  možnost přispět na <https://fsfe.org/donate/>.

options:
  -h, --help            zobrazit tuto nápovědu a ukončit
  --debug               povolit příkazy pro ladění
  --suppress-deprecation
                        hide deprecation warnings
  --include-submodules  nepřeskakovat submoduly systému Git
  --include-meson-subprojects
                        nepřeskakovat podprojekty Meson
  --no-multiprocessing  nepoužívat multiprocessing
  --root PATH           definovat kořen projektu
  --version             zobrazit číslo verze programu a ukončit jej

dílčí příkazy:
  {annotate,download,lint,spdx,supported-licenses,supported-licences,convert-dep5}
    annotate            přidání autorských práv a licencí do záhlaví souborů
    download            stáhněte si licenci a umístěte ji do adresáře LICENSES/
    lint                seznam všech nevyhovujících souborů
    spdx                vytisknout výkaz materiálu projektu ve formátu SPDX
    supported-licenses (supported-licences)
                        seznam všech podporovaných licencí SPDX
    convert-dep5        convert .reuse/dep5 to REUSE.toml

real	0m8,134s
user	0m4,414s
sys	0m3,669s

Reuse 3.0.2:

$ time reuse 
použití: reuse [-h] [--debug] [--suppress-deprecation] [--include-submodules] [--include-meson-subprojects] [--no-multiprocessing] [--root PATH] [--version]
               {annotate,download,init,lint,spdx,supported-licenses,supported-licences} ...

reuse je nástrojem pro dodržování doporučení REUSE. Další informace naleznete
na adrese <https://reuse.software/> a online dokumentaci na adrese
<https://reuse.readthedocs.io/>.

Tato verze reuse je kompatibilní s verzí 3.0 specifikace REUSE.

Podpořte činnost FSFE:

  Dary jsou pro naši sílu a nezávislost zásadní. Umožňují nám pokračovat v
  práci pro svobodný software všude tam, kde je to nutné. Zvažte prosím
  možnost přispět na <https://fsfe.org/donate/>.

options:
  -h, --help            zobrazit tuto nápovědu a ukončit
  --debug               povolit příkazy pro ladění
  --suppress-deprecation
                        hide deprecation warnings
  --include-submodules  nepřeskakovat submoduly systému Git
  --include-meson-subprojects
                        nepřeskakovat podprojekty Meson
  --no-multiprocessing  nepoužívat multiprocessing
  --root PATH           definovat kořen projektu
  --version             zobrazit číslo verze programu a ukončit jej

dílčí příkazy:
  {annotate,download,init,lint,spdx,supported-licenses,supported-licences}
    annotate            přidání autorských práv a licencí do záhlaví souborů
    download            stáhněte si licenci a umístěte ji do adresáře LICENSES/
    init                inicializace projektu REUSE
    lint                seznam všech nevyhovujících souborů
    spdx                vytisknout výkaz materiálu projektu ve formátu SPDX
    supported-licenses (supported-licences)
                        seznam všech podporovaných licencí SPDX

real	0m0,196s
user	0m0,150s
sys	0m0,068s
@carmenbianca carmenbianca added enhancement New feature or request regression Regression, something worked before, but not any more labels Jul 4, 2024
@carmenbianca
Copy link
Member

Hi @nijel, thanks for the issue! I will take a look at this soon.

@carmenbianca
Copy link
Member

I fixed this in #1047, but it's momentarily blocked by the fact that it slightly breaks with the spec. That requires a little more discussion, so there won't be a fix immediately. This is still a priority issue, though.

nijel added a commit to WeblateOrg/weblate that referenced this issue Jul 18, 2024
4.x is horribly slow making it uncomfortable to use in pre-commit,

See fsfe/reuse-tool#1033
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request regression Regression, something worked before, but not any more
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants