diff options
| -rw-r--r-- | Makefile | 3 | ||||
| -rw-r--r-- | benchmarks/http/run.py | 6 | ||||
| -rw-r--r-- | docs/design/009-layout.md | 9 |
3 files changed, 17 insertions, 1 deletions
@@ -33,8 +33,9 @@ $(BUILD)/libpure.a: $(OBJECTS) $(AR) rcs $@ $^ # The runtime's tickets and budgets, with effects completed off the owner thread. +# It links after the library, last as it always was, so code keeps its place. $(BUILD)/pure-serve: $(SERVE) core/runtime.c $(BUILD)/libpure.a $(HEADERS) - $(CC) $(CPPFLAGS) $(CFLAGS) $(INCLUDES) -Iserve -DPURE_ASYNC_EFFECTS $(SERVE) core/runtime.c $(BUILD)/libpure.a \ + $(CC) $(CPPFLAGS) $(CFLAGS) $(INCLUDES) -Iserve -DPURE_ASYNC_EFFECTS $(SERVE) $(BUILD)/libpure.a core/runtime.c \ $(LDFLAGS) -lssl -lcrypto -lm -pthread $(LDLIBS) -o $@ $(BUILD)/pure-run: cli/pure-run.c $(BUILD)/libpure.a $(HEADERS) diff --git a/benchmarks/http/run.py b/benchmarks/http/run.py index 4605226..2372595 100644 --- a/benchmarks/http/run.py +++ b/benchmarks/http/run.py @@ -141,6 +141,8 @@ def main(): parser.add_argument('--rounds', type=int, default=1, help='repeat every server, rotating their order') parser.add_argument('--pause', type=float, default=0, help='seconds to rest the device between runs') parser.add_argument('--budget', type=int, default=64 << 20, help="Pure's payload budget in bytes") + parser.add_argument('--baseline', type=Path, help='another pure-serve binary (an earlier build) run in turn with this ' + "one, as pure-serve-baseline; --threads N as pure-serve-N's") args = parser.parse_args() axum = HERE / 'axum-baseline/target/release/axum-baseline' drogon = HERE / 'drogon-baseline/drogon-baseline' @@ -154,6 +156,10 @@ def main(): '--budget', str(args.budget), '--threads', '3'], 'pure-serve-2': lambda d: [PURE / 'build/pure-serve', '--module', args.module, '--store', d, '--port', '0', '--budget', str(args.budget), '--threads', '2'], + **({f'pure-serve{suffix}-baseline': (lambda threads: lambda d: [args.baseline.resolve(), '--module', args.module, '--store', d, + '--port', '0', '--budget', str(args.budget), + *(['--threads', threads] if threads else [])])(threads) + for suffix, threads in (('', ''), ('-3', '3'), ('-2', '2'))} if args.baseline else {}), 'axum-memory': lambda d: [axum, '--port', '0'], 'axum-durable': lambda d: [axum, '--port', '0', '--durable', d], 'axum-atomic': lambda d: [axum, '--port', '0', '--atomic', d], diff --git a/docs/design/009-layout.md b/docs/design/009-layout.md index 8cb9a78..17d6a48 100644 --- a/docs/design/009-layout.md +++ b/docs/design/009-layout.md @@ -54,6 +54,15 @@ GET, 입력이 POST)에는 어휘가 필요 없기 때문이다. 모듈 형식� `java.net`과 HTTP 서버를 담고 JavaFX를 따로 두는 것과 같은 선이다. `pure-ui`라는 이름은 UI가 런타임의 일부라는 뜻이 되어, 런타임이 화면을 모른다는 분리와 어긋난다. +## 비용 + +같은 소스를 옮기기 전(`5239052`)처럼 한 명령으로 빌드한 것과 라이브러리로 링크한 것을 번갈아 쟀다(Pi 5, 점수판 앱, +연결 스레드 3, 라운드 6번씩 3초, 요청당 CPU). 라이브러리라는 구조의 비용은 없다. 한 명령 빌드도 오브젝트 순서를 라이브러리 +빌드와 같게 하면 크기(228,041 B)와 효율이 같다(total +0.4%, page +0.2%). 남은 차이는 코드 배치다. `runtime.c`를 예전처럼 +마지막에 링크하면 예전 순서와 total −0.4%, page +1.2%, mixed −0.1%로 같은 빌드끼리의 라운드 차이(±1%) 안이다. 크기는 +5,008 B 줄었다. 쓰지 않는 `flow.c` 함수(516 B)를 라이브러리에서 끌어오지 않고, 예전 바이너리에 있던 링커의 Cortex-A53 +오류 회피 분기 자리(4 KiB 정렬 여백)가 없다. 벤치마크의 `--baseline`으로 다시 잴 수 있다. + ## 확인 최상위 `make check`(저장소와 앱 모델의 검사), `prototypes/connections`의 `make check`·`check-tree`·`check-core`, aup |
