aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/rosa/rosa.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-05-18 22:18:09 +0900
committerOphestra <cat@gensokyo.uk>2026-05-18 22:18:09 +0900
commit682b3a2ce53252b2bd0c0da86c89c392f74f68e0 (patch)
treeed1c0c519b64ff242fa9b8153fbbcb33bcf3ccea /internal/rosa/rosa.go
parent594221eb78fede12840121982782a470e6ed29d0 (diff)
internal/rosa: track evaluation time
Useful to track performance regressions over migrations. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/rosa/rosa.go')
-rw-r--r--internal/rosa/rosa.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/internal/rosa/rosa.go b/internal/rosa/rosa.go
index d9d0b9ef..b29fd605 100644
--- a/internal/rosa/rosa.go
+++ b/internal/rosa/rosa.go
@@ -10,6 +10,7 @@ import (
"strconv"
"strings"
"sync"
+ "time"
"hakurei.app/fhs"
"hakurei.app/internal/pkg"
@@ -612,6 +613,12 @@ var native S
// Native returns the global [S].
func Native() *S { return &native }
+// evalTime is the duration of the initial built-in evaluation.
+var evalTime time.Duration
+
+// EvalTime returns the duration of the initial built-in evaluation.
+func EvalTime() time.Duration { return evalTime }
+
// nativeB is the backing directory of built-in azalea-based [Artifact]
// implementations.
//
@@ -623,8 +630,10 @@ func init() {
if err != nil {
panic(err)
}
+ t := time.Now()
if err = native.EvaluateFS(sub); err != nil {
println(err.Error())
os.Exit(1)
}
+ evalTime = time.Since(t)
}