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

--list-all spends time globbing for sources. #1322

Open
StefanBRas opened this issue Sep 1, 2023 · 2 comments
Open

--list-all spends time globbing for sources. #1322

StefanBRas opened this issue Sep 1, 2023 · 2 comments
Labels
area: loops Changes related to looping over tasks/commands. type: performance Issues with optimisation or performance.

Comments

@StefanBRas
Copy link

task --list-all is computing something even though it seems like it shouldn't to show the list of tasks.

It's an problem because autocompletion relies on --list-all so right now it's not usable for me.

It takes ~2 seconds (user time, 12 system) to run --list-all.

Not directly related, but it seems to be some interaction with globbing for sources and using for in commands that makes it take a long time to run in general.

Given this task file

version: '3'
tasks:
  default:
    sources:
    - dev/*.json
    cmds:
      - for: sources
        cmd: echo {{ dir .ITEM }}

It takes again 2 seconds ish, but

version: '3'
tasks:
  default:
    sources:
    - "dev/*.json"
    cmds: 
    - "echo hey"

is instant.

It's difficult to recreate, because it's only for some folders it takes a long time. I think it's related to #225.

  • Task version: v3.28.0 (h1:PGYGwevlGQdYrqhO6lLCYylC7YuGoQLlVwHkO42gf0I=)
  • Operating system: macOS ventura 13.5
  • Experiments enabled: No
@task-bot task-bot added the state: needs triage Waiting to be triaged by a maintainer. label Sep 1, 2023
@krystian-panek-vmltech
Copy link

also --dry spends time evaluating dynamic variables; I am not sure if it is always desired; it's more irritating to me than helping

@pd93 pd93 added type: performance Issues with optimisation or performance. area: loops Changes related to looping over tasks/commands. and removed state: needs triage Waiting to be triaged by a maintainer. labels Sep 14, 2023
@mishamsk
Copy link

Same issue here. Started noticing recently. Happens both for task --list and task --list-all. Task version: 3.38.0 ()

Checked usage of for, doesn't seem like a culprit. I have two checkouts of the same repo with a Taskfile. autocomplete works reasonably fast in one folder, but not the other. The only difference that I've see is the size of the folders (e.g. one has node_modules populated and the other don't). I do have tasks that defines sources keys, I also have tasks with preconditions that run find.

I haven't yet triaged the issue to narrow it down to a specific task. I can, assuming anyone from maintainers have capacity to look into this.

Also, I may be missing something, but it looks like list output contains only task names and descriptions. These are all static, so theoretically there is no need to execute anything at all. Just parse yaml. But I may not thinking about some feature of Taskfile of course.

In general - awesome tool, great work and kudos to the team!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: loops Changes related to looping over tasks/commands. type: performance Issues with optimisation or performance.
Projects
None yet
Development

No branches or pull requests

5 participants