logseq / logseq/db-test

Performance freeze when opening parent namespace page due to automatic deep-expansion of child blocks

Open
#970 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
No language data
Stars
28
Forks
2
PR merge metrics
No merged PRs in 30d

Description

### Search first

- [x] I searched and no similar issues were found

### What Happened?

Similar to #619 (However, #619 also specifies properties being expanded, whereas this focus is strictly on block depth expansion)

When opening a parent namespace page that contains a massive hierarchy of sub-pages and blocks, Logseq attempts to fully expand every single child block/page. For large graphs, this causes the application to freeze entirely.

For example: I have a namespace that goes like Pathology/Category 1/Category 2/Specific entity
If I try to open Pathology then the page essentially freezes because i have around 20k blocks in total when you combine all the subcategories and Logseq tries to open all the child blocks.

### Reproduce the Bug

1. Create a namespace with multiple children
2. You will see that in the most upper level namespace every single entity is displayed

### Expected Behavior

You can control to what depth the children nodes are shown

### Screenshots

Image

### Files

_No response_

### Browser, Desktop or Mobile Platform Information

macOS, latest overnight build

### Additional Context

_No response_

### Are you willing to submit a PR? If you know how to fix the bug.

- [ ] I'm willing to submit a PR (Thank you!)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the freeze with a namespace containing a large, deeply nested hierarchy, using the macOS overnight build described in the issue. Trace the code responsible for expanding child pages and blocks when opening the parent namespace; done means opening remains responsive and child visibility can be limited by depth.

Written by the indexing model from the issue text.

Assessment

Domain
frontend, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.