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

Command History gets really slow when >1000 items #325

Closed
mofojed opened this issue Dec 2, 2021 · 2 comments · Fixed by #1145
Closed

Command History gets really slow when >1000 items #325

mofojed opened this issue Dec 2, 2021 · 2 comments · Fixed by #1145
Assignees
Labels
bug Something isn't working web-client-ui
Milestone

Comments

@mofojed
Copy link
Member

mofojed commented Dec 2, 2021

Description

When there are lots of items in the command history (more than 1000) it gets really slow when scrolling

Steps to reproduce

  1. Add >1000 items to command history
  2. Scroll up and down quickly

Expected results
2. Able to see command history quickly

Actual results
2. Shows a blank screen when scrolling, takes a few seconds for the information to appear

@mofojed mofojed added bug Something isn't working triage Issue requires triage labels Dec 2, 2021
@mofojed mofojed self-assigned this Dec 2, 2021
@mofojed mofojed added this to the February 2022 milestone Feb 2, 2022
@mofojed mofojed removed the triage Issue requires triage label Feb 2, 2022
@mofojed mofojed modified the milestones: February 2022, March 2022 Mar 1, 2022
@mofojed mofojed modified the milestones: March 2022, April 2022 Apr 5, 2022
@mofojed mofojed modified the milestones: April 2022, May 2022 May 2, 2022
@vbabich vbabich modified the milestones: May 2022, June 2022 Jun 1, 2022
@mofojed mofojed modified the milestones: June 2022, July 2022 Jul 5, 2022
@mofojed mofojed modified the milestones: July 2022, August 2022 Jul 25, 2022
@mofojed mofojed modified the milestones: August 2022, September 2022 Sep 9, 2022
@mofojed mofojed modified the milestones: September 2022, October 2022 Oct 3, 2022
@mofojed mofojed modified the milestones: October 2022, November 2022 Nov 16, 2022
@mofojed mofojed modified the milestones: November 2022, December 2022 Dec 5, 2022
mofojed added a commit to mofojed/web-client-ui that referenced this issue Dec 28, 2022
- We were mutating objects within the state, violating the immutability principle.
- Clone any object that we were mutating.
- Cleaned up some of the code.
- All tests pass
- Tested by running the steps in the description of deephaven#325, also tested importing a CSV and giving it the same name as a prior object. Old objects were updated correctly.
- Fixes deephaven#325
@mofojed
Copy link
Member Author

mofojed commented Feb 27, 2023

When deephaven-core has persistence, we could implement command history server side rather than storing in the browser locally (with PouchDB). However, that persistence is not currently roadmapped so is not coming any time soon.

In the meantime, we should look at what is causing the performance to be so slow with just a few thousand items. I find it surprising that this can't be handled quickly within the browsers local storage.

@mofojed
Copy link
Member Author

mofojed commented Mar 6, 2023

Investigate why it is slow, then decide whether we need to just truncate the CommandHistory at some time.

@mofojed mofojed modified the milestones: February 2023, March 2023 Mar 8, 2023
bmingles added a commit to bmingles/web-client-ui that referenced this issue Mar 9, 2023
bmingles added a commit to bmingles/web-client-ui that referenced this issue Mar 9, 2023
bmingles added a commit to bmingles/web-client-ui that referenced this issue Mar 9, 2023
bmingles added a commit to bmingles/web-client-ui that referenced this issue Mar 10, 2023
bmingles added a commit to bmingles/web-client-ui that referenced this issue Mar 13, 2023
bmingles added a commit to bmingles/web-client-ui that referenced this issue Mar 13, 2023
bmingles added a commit to bmingles/web-client-ui that referenced this issue Mar 13, 2023
bmingles added a commit to bmingles/web-client-ui that referenced this issue Mar 13, 2023
bmingles added a commit to bmingles/web-client-ui that referenced this issue Mar 13, 2023
Added logic to "prune" db if it gets too large

[deephaven#325]
bmingles added a commit to bmingles/web-client-ui that referenced this issue Mar 14, 2023
bmingles added a commit to bmingles/web-client-ui that referenced this issue Mar 14, 2023
bmingles added a commit to bmingles/web-client-ui that referenced this issue Mar 14, 2023
bmingles added a commit to bmingles/web-client-ui that referenced this issue Mar 15, 2023
bmingles added a commit to bmingles/web-client-ui that referenced this issue Mar 15, 2023
bmingles added a commit to bmingles/web-client-ui that referenced this issue Mar 15, 2023
bmingles added a commit to bmingles/web-client-ui that referenced this issue Mar 15, 2023
bmingles added a commit to bmingles/web-client-ui that referenced this issue Mar 15, 2023
bmingles added a commit to bmingles/web-client-ui that referenced this issue Mar 16, 2023
bmingles added a commit to bmingles/web-client-ui that referenced this issue Mar 16, 2023
bmingles added a commit to bmingles/web-client-ui that referenced this issue Mar 16, 2023
bmingles added a commit to bmingles/web-client-ui that referenced this issue Mar 17, 2023
bmingles added a commit to bmingles/web-client-ui that referenced this issue Mar 17, 2023
bmingles added a commit that referenced this issue Mar 17, 2023
I've tested this with 72,000 total records in the PouchDB (70K marked as
deleted + 2-2.5K active).

When 2,000 non-deleted records are present, I bulk insert 500 records.
This gets the count up to 2,500 documents. If I push 1 more, the pruning
behavior kicks in and marks the oldest 501 as deleted resulting in 2,000
active documents.

Fixes #325
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working web-client-ui
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants