You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Performance tests measure the throughput (operations per second) of server-side functions and compare against baseline rates stored in profile CSV files.
4
+
5
+
## How it works
6
+
7
+
Each performance test:
8
+
9
+
1. Runs a function in a loop for 30 seconds and calculates the current rate (ops/sec).
10
+
2. Looks up the baseline rate for that test in the active profile CSV.
11
+
3. If no entry exists, a new one is saved to the profile using the current rate and the profile-level default tolerances.
12
+
4. Asserts that the current rate falls within `[baseline * lower_tolerance, baseline * upper_tolerance]`.
13
+
14
+
## Profiles
15
+
16
+
Profile CSVs live in `perf_files/` and contain columns:
17
+
18
+
| Column | Description |
19
+
|--------|-------------|
20
+
|`refer_name`| Unique test identifier (e.g. `meanDS::perf::numeric::0`) |
21
+
|`rate`| Baseline ops/sec |
22
+
|`lower_tolerance`| Multiplier for the lower bound (e.g. `0.5` = 50% of baseline) |
23
+
|`upper_tolerance`| Multiplier for the upper bound (e.g. `2.0` = 200% of baseline) |
24
+
25
+
Available profiles:
26
+
27
+
-`default_perf_profile.csv` -- default baseline
28
+
-`performance_refactor_profile.csv` -- for local development; no effective upper limit
If not set, `perf_rate.R` defaults to `perf_files/default_perf_profile.csv`.
41
+
42
+
## Self-populating entries
43
+
44
+
When a test has no entry in the active profile, `perf.reference.save()` creates one using the current measured rate and the profile-level tolerances (`perf.profile.tolerance.lower/upper()`), which are read from the first row of the profile CSV. This means new tests automatically inherit the tolerance policy of whichever profile is active.
45
+
46
+
## Skipping
47
+
48
+
Performance tests are skipped on CRAN (`skip_on_cran()`) and CI (`skip_on_ci()`) by default, since results are hardware-dependent.
0 commit comments