Repository navigation
fix(sdlc): no temp-file deletions on the hot paths (v2.24.1) - #88
Merged
Merged
Conversation
bash 3.2는 here-string을 임시 파일로 만들고 지운다. 파일 삭제가 느린 기기에서 sdlc.sh status가 18~48초, 할 일 쓰기가 14~22초 걸렸다. sdlc.sh의 here-string 9곳을 프로세스 치환으로 바꾸고, 할 일 잠금 표시를 빈 디렉터리로 바꿨다. 출력은 같다.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On a machine where every file deletion took 5.4 s,
sdlc.sh statustook 18 to 48 s while using 0.18 s of CPU, and one to-do write took 14 to 22 s. The to-do CLI runsstatusfor every open item, so with 41 open items a call ran for minutes and callers with a 20 s limit failed.sdlc.shread its state with here-strings; bash 3.2 (macOS/bin/bash) writes each to a temp file and deletes it.statusran eight.Changes
sdlc.sh: the nine here-strings read from< <(printf '%s\n' ...)(same bytes through a pipe).mkdir/rmdir). A marker left by an older kit is a file and is still removed.sdlc.shcontains a here-string; a to-do test checks the commit marker held during a save is a directory.VERSION2.24.1,log/changelog-v2.24.1.md.Verification (local, on the affected machine)
status <slug> --json, old vs new, 3 real slugsstatuswall timeadd/note/done, scratch file)--test-name-pattern=marker)bash -n sdlc.sh,bash -n tests/selftest.sh,node --check todo/core.mjsThe full selftest was not run locally: the slow deletions make the suite time out there. CI on the three platforms is the full run.
Upgrade
Restart a running to-do app (
todo.mjs serve) after upgrading.