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

optimise fs reads #6450

Merged
merged 2 commits into from Sep 7, 2023
Merged

optimise fs reads #6450

merged 2 commits into from Sep 7, 2023

Conversation

jackkav
Copy link
Contributor

@jackkav jackkav commented Sep 6, 2023

changelog(Improvements): Added some optimizations to filesystem read frequency in order to improve Insomnia's performance

motivation: sidebar rendering speed is very slow since moving app state from redux to remix, this is due to the lifespan changing dramatically, previously the redux state was a copy of the db created at app start and listened for all changes, potentially causing rerenders after a db write where useSelector was used but reads were always to the redux in memory store. Currently the read are always to the database and happen at remix loaders which run at app start and also on every action. This means the current lifespan is very short so forces re-computation.

ideas:

  • optimise filesystems reads so they are batched together and not happening in a recursive loop between computations.
  • recreate the client side state cache synced with the database ideally without redux.

highlight

  • only recursively access folders from fs
  • other fs reads happen inline and not during recursion which saves on hdd read frequency

todo:

  • remove timers

recording is taken after typing in the body causing a remix action and the loader to reload
basline with 100 requests and one folder
image

after batching fs reads rather than recursing
image

future work

  • if the tree is built in main then it could offer gains by making far fewer ipc roundtrips
  • moving filter out of the loader and into the render component will make filter instant

notes:

  • there is also a perf issue in the sidebar gridlist component blocking layout effects

@gatzjames gatzjames merged commit f5d2608 into Kong:develop Sep 7, 2023
6 of 7 checks passed
jackkav added a commit to jackkav/insomnia that referenced this pull request Nov 24, 2023
* optimise fs reads

* remove timers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants