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

CPU usage management #48

Closed
franciscoabenza opened this issue Mar 7, 2023 · 11 comments
Closed

CPU usage management #48

franciscoabenza opened this issue Mar 7, 2023 · 11 comments

Comments

@franciscoabenza
Copy link

franciscoabenza commented Mar 7, 2023

Absolute hog for CPU.
Please let the user change how often is the cycle for calculating smart connections

@brianpetro
Copy link
Owner

Right now calculations happen when you open a note, and the results are cached during the session.

I suppose those caches can could persist after you close Obsidian, but that would risk serving outdated results.

Another possibility is selectively persisting the cache.

And as I'm typing, I think the caching mechanism might need to be updated since updating the results to include snippets. These snippets may not be cached, causing unnecessary file reads.

I'll take a deeper look into this. Thanks for bringing the issue to my attention @franciscoabenza

@pinuke
Copy link
Contributor

pinuke commented Mar 7, 2023

I suppose those caches can could persist after you close Obsidian, but that would risk serving outdated results.

Another possibility is selectively persisting the cache.

And as I'm typing, I think the caching mechanism might need to be updated since updating the results to include snippets. These snippets may not be cached, causing unnecessary file reads.

I recommend a caching mechanism that runs a checksum and checks the mod time of the opened note.

If the Checksum didn't change and the mod time didn't, in theory it should be feasible to automatically detect when to persist the cache.

I'd look into a good, but performant checksum algorithm for JavaScript

@brianpetro
Copy link
Owner

@smartguy1196 Thanks for suggestion.

Those are already being used to determine when to re-embed. But using them as a caching trigger is a little trickier because the cache depends on other notes and not just the current note. It can be done, but it will take working through the necessary logic to make sure caches get expired appropriately.

@franciscoabenza
Copy link
Author

franciscoabenza commented Mar 8, 2023 via email

@brianpetro
Copy link
Owner

So many potential features by the way.

Did you have anything specific in mind for this?

@franciscoabenza thanks for your help!

@franciscoabenza
Copy link
Author

franciscoabenza commented Mar 8, 2023 via email

@brianpetro
Copy link
Owner

@franciscoabenza I really like the way you are thinking. Would you mind elaborating a little more for me? I think you're on to something, and I might be able to make it happen.

@franciscoabenza
Copy link
Author

This is something quite close to my core and the type of software that I am working on (So I may be able to colab). If you want you can add yourself to my calendar (after the 16 March) and we can discuss it further. Book time, It doesn't have to be long :)
If you can't/don't want to do a call, I can also put some time on giving you a more comprehensive explanation and a feature list 👍

@brianpetro
Copy link
Owner

@franciscoabenza Scheduled!

Please don't hesitate to add any feature requests in the meantime. We could always use them as a basis for our chat.

Looking forward to it. Thank you!

@pinuke
Copy link
Contributor

pinuke commented Mar 11, 2023

Always good to see collaborative work!

@franciscoabenza
Copy link
Author

I don't know if anything changed but my CPU seem to have a reasonable use allocated :) so I am going to close this ;)

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

No branches or pull requests

3 participants