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

EmmyLua: save timestamps of docs.json to skip if no change #278

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

muescha
Copy link
Contributor

@muescha muescha commented Aug 8, 2022

save timestamps in to a file timestamps.json to check if docs.json are changed.
if not changed then skip the file check

add also a check to skip the writing to timestamps.json

@muescha muescha mentioned this pull request Aug 8, 2022
@xaviervalarino
Copy link

@muescha happy to see someone else was experiencing startup lag in Hammerspoon caused by EmmyLua uneccessarily reading the jsonDocs files.

I was about to submit a PR for this before I came across yours. The main difference is that I am storing timestamps in hs.settings instead of writing it out to a JSON file. I think using hs.settings as a serialized store is slightly faster than reading and writing to JSON, but the speed-up is probably negligible. You can see the diff here: xaviervalarino@848284a

Looking at yours, I do think storing the timestamp in the local settings variable is the way to go.

Hope this PR gets merged, as it significantly speeds up Hammerspoon's startup time when there are no new docs for EmmyLua to generate.

@muescha
Copy link
Contributor Author

muescha commented Sep 15, 2022

My solution don't blow up the internal memory with data, which is maybe unused when he deactive the spoon.

Storing the timestamps in a file gives the user the control over the metadata.

A user can not delete the (unknown) meta data stored in hs.settings

@xaviervalarino
Copy link

Thanks for pointing that out. I had not considered having the data hanging around.

@muescha
Copy link
Contributor Author

muescha commented Nov 2, 2022

@cmsj irc GitHub Action ist hanging

@pecigonzalo
Copy link

I believe this was ready to merge, could we re-run the CI check?

change formatting - remove whitespace - to get CI Checks run again
@muescha
Copy link
Contributor Author

muescha commented Jun 29, 2023

@pecigonzalo I changed some whitespace to re-run CI Check - now all checks have passed :)

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

4 participants