Closed muescha closed 3 months ago
@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: https://github.com/xaviervalarino/Spoons/commit/848284ae9362c3d9a53c1a98cef7dc5d6dc9b452
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.
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
Thanks for pointing that out. I had not considered having the data hanging around.
@cmsj irc GitHub Action ist hanging
I believe this was ready to merge, could we re-run the CI check?
@pecigonzalo I changed some whitespace to re-run CI Check - now all checks have passed :)
thx :)
save timestamps in to a file
timestamps.json
to check ifdocs.json
are changed. if not changed then skip the file checkadd also a check to skip the writing to
timestamps.json