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

Performance drop in 2.0.0 release #1800

Closed
2 of 7 tasks
claremacrae opened this issue Mar 25, 2023 · 5 comments · Fixed by #1801
Closed
2 of 7 tasks

Performance drop in 2.0.0 release #1800

claremacrae opened this issue Mar 25, 2023 · 5 comments · Fixed by #1801
Assignees
Labels
scope: performance issues Issues with speed or responsiveness scope: rendering of tasks How the plugin displays tasks (except CSS issues) type: bug Something isn't working

Comments

@claremacrae
Copy link
Collaborator

Please check that this issue hasn't been reported before.

  • I searched previous Bug Reports didn't find any similar reports.

Expected Behavior

The following all work correctly in Tasks 1.25.0

Scenario 1

  • Given an open note in Reading or Live Preview
    • That has one or more Tasks blocks in:
  • When I edit any Task in my Vault
  • Then each of those Tasks blocks should only be redrawn once

Scenario 2

  • Given an open note in Reading or Live Preview
    • That has one or more Tasks blocks in:
  • When I close the note
  • Then edits to tasks in my vault should no longer trigger updates to the closed Tasks blocks

Current behaviour

The behavior in Tasks 2.0.0

Scenario 1

  • Given an open note in Reading or Live Preview
    • That has one or more Tasks blocks in:
  • When I edit any Task in my Vault
  • Then each of those Tasks blocks is redrawn twice

Scenario 2

  • Given an open note in Reading or Live Preview
    • That has one or more Tasks blocks in:
  • When I close the note
  • Then edits to tasks keep on updating the tasks blocks in closed files

Steps to reproduce

Tasks 1.25.0

  • Open Obsidian with Tasks 1.25.0 enabled
  • Open a note with a query in - in Reading
  • Open a note a task in
  • Open the console
  • Toggle the task 2 or 3 times, and get a feeling for the appearance of the following types of message in the console:
At least one task, its line number or its heading has changed in ACME.md: triggering a refresh of all active Tasks blocks in Live Preview and Reading mode views.

Render tasks called for a block in active file "Test Query.md", to select from 606 tasks: plugin state: Warm

5 of 606 tasks displayed in a block in "Test Query.md"
  • Then work through the Given/When/Then steps above

You will see the behaviour described above.

Tasks 2.0.0

Now repeat the above with 2.0.0, and you will see the same number of 'task has changed' messages - but a lot more 're-rendering' messages, even for files you have closed.

Which Operating Systems are you using?

  • Android
  • iPhone/iPad
  • Linux
  • macOS
  • Windows

Obsidian Version

1.1.16

Tasks Plugin Version

2.0.0

Checks

  • I have tried it with all other plugins disabled and the error still occurs

Possible solution

No response

@claremacrae claremacrae added type: bug Something isn't working scope: performance issues Issues with speed or responsiveness labels Mar 25, 2023
@claremacrae
Copy link
Collaborator Author

I have done a git bisect and this log was:

git bisect start

Reverting d7593a2 does fix the problem.

@claremacrae
Copy link
Collaborator Author

I've asked for advice in Discord.
https://discord.com/channels/686053708261228577/840286264964022302/1088950909293314162

No replies yet.

@claremacrae
Copy link
Collaborator Author

@ilandikov - For your information... Sorry to be the bearer of this news, and really sorry that I did not spot it in testing the fix for #1732.

This is the source of the big slow-down in editing in 2.0.0 that I mentioned...

@gypsyav - We will need to try and find a fix for the canvas bug that doesn't hit the Tasks rendering efficiency.

Otherwise, sadly, I think I may need to do a bug-fix release in the next day or two that reverts the slow-down.

@ilandikov
Copy link
Collaborator

ilandikov commented Mar 25, 2023

Oh wow. Well the fix was inspired by blacksmithgu/obsidian-dataview#1661
I wonder why that didn't (?) slow the dataview plugin down.

In the meantime it is definitely worth it to revert the bug fix.

@claremacrae
Copy link
Collaborator Author

I had the same thought, and let the dataview author know in Discord that it would be worth checking if it does.

The Dataview code is a lot more optimised for speed than Tasks, so there could be something else there that prevents wasted redraws, for example.

claremacrae added a commit that referenced this issue Mar 26, 2023
This reverts commit d7593a2.

Fixes #1800, but reopens #1732
@claremacrae claremacrae added the scope: rendering of tasks How the plugin displays tasks (except CSS issues) label Mar 26, 2023
@claremacrae claremacrae self-assigned this Mar 26, 2023
claremacrae added a commit that referenced this issue Mar 26, 2023
* Revert "fix: render in canvas (#1733)"

This reverts commit d7593a2.

Fixes #1800, but reopens #1732

* docs: Document limitations with Canvas cards.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: performance issues Issues with speed or responsiveness scope: rendering of tasks How the plugin displays tasks (except CSS issues) type: bug Something isn't working
Projects
Status: 🎉 Released
Development

Successfully merging a pull request may close this issue.

2 participants