From 00e5de525bde5d0d77d9553c6126908f2fdfde20 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 15 Feb 2026 14:14:32 +0200 Subject: Improve --generate performance with incremental builds (62s -> 2s) Add mtime-based skip logic to avoid regenerating unchanged files: - generate::fromgmi skips .gmi files where all outputs are newer - template::_generate_file skips templates when output is fresh - Diff-before-overwrite in templates, gemfeed, and notes indexes to preserve mtimes and prevent cascading cache invalidation - Global dependency check (.lastgen sentinel) for header/footer/CSS - Job throttling via wait -n capped at nproc cores - Add --force flag and FORCE_REBUILD env var to bypass skip logic - Fix misleading atom feed "empty cache" log message Co-Authored-By: Claude Opus 4.6 --- lib/atomfeed.source.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/atomfeed.source.sh') diff --git a/lib/atomfeed.source.sh b/lib/atomfeed.source.sh index 4b598a7..3fe46be 100644 --- a/lib/atomfeed.source.sh +++ b/lib/atomfeed.source.sh @@ -61,7 +61,11 @@ atomfeed::generate () { local -r atom_file="$gemfeed_dir/atom.xml" log INFO "Generating Atom feed to $atom_file" - log INFO 'This may takes a while with an empty cache....' + + # Only warn about slow generation when the cache is actually empty + if [ ! -d "$CONTENT_BASE_DIR/cache" ] || [ -z "$(ls "$CONTENT_BASE_DIR/cache/gemfeed/" 2>/dev/null)" ]; then + log INFO 'This may take a while with an empty cache....' + fi cat < "$atom_file.tmp" -- cgit v1.2.3