From c8088839270c8994c0533d2fbfec7e5ade69cb57 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 30 Nov 2026 18:07:34 +0000 Subject: populate file: skip sources rsync would find nothing to do for Each rsync run costs several round trips to the target, and about 45 ms of rsync waiting for its own processes, also with nothing to transfer, so a run with many file sources and nothing to change took long: 25.5 s for the bench's 50 file, 30 symlink, and 20 git sources with 30 ms to the target, 20 s of that waiting for round trips. Right after taking the lock, one command lists the target paths of the file sources that are directories, compared by size and time, and whose lock file the flakes step doesn't rewrite, with find. At its turn, each such source lists what rsync would transfer: with find, if nothing excludes or filters anything, else with rsync --list-only, which is also the run checking the .rsync-filter files, instead of a dry run. If both listings have the same entries, with mode and path, and for files size and time in whole seconds, and for symlinks the target, which is what rsync's quick check compares, neither break_hard_links nor rsync runs. Entries populate can't compare (paths with control characters, devices), and sources that need --insecure-links, run rsync. The scenario file-skip checks that an unchanged source keeps another hard link of a file, which break_hard_links would break, and that a file too many, a file's time, a directory's mode, and an excluded file make the sources deliver again. --- pkgs/populate/src/record.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pkgs/populate/src/record.rs') diff --git a/pkgs/populate/src/record.rs b/pkgs/populate/src/record.rs index dd52bda..b927317 100644 --- a/pkgs/populate/src/record.rs +++ b/pkgs/populate/src/record.rs @@ -28,7 +28,7 @@ pub fn now() -> String { } /// seconds since the epoch, in UTC, like 2026-11-20T12:34:56Z. -fn timestamp(seconds: u64) -> String { +pub fn timestamp(seconds: u64) -> String { let (days, rest) = (seconds / 86400, seconds % 86400); // The proleptic Gregorian calendar's date of a day since the epoch, // after Howard Hinnant's civil_from_days, with eras of 400 years -- cgit v1.3.1