@rokkit/data 1.0.0-next.151 → 1.0.0-next.152
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -0
- package/package.json +4 -2
- package/src/dataset.js +1 -5
package/README.md
CHANGED
|
@@ -133,6 +133,30 @@ const filters = parseFilters('age >= 18 AND status = "active"')
|
|
|
133
133
|
| `renamer(mapping)` | Create a function that renames object keys |
|
|
134
134
|
| `model(data)` | Create a reactive data model |
|
|
135
135
|
|
|
136
|
+
## Benchmarks
|
|
137
|
+
|
|
138
|
+
Results from `benchmark/results/p4-lazy-fusion.json` — Bun 1.3.11, Apple Silicon (arm64).
|
|
139
|
+
All times in **ms (mean)** over 10 iterations. Dataset sizes: small = 100 rows, medium = 1 000 rows, large = 10 000 rows.
|
|
140
|
+
|
|
141
|
+
| Operation | Small | Medium | Large |
|
|
142
|
+
| --------------------------- | ----: | -----: | -----: |
|
|
143
|
+
| `groupBy` + `rollup` | 0.113 | 0.236 | 1.617 |
|
|
144
|
+
| `groupBy` + `summarize` + `rollup` | 0.042 | 0.097 | 0.534 |
|
|
145
|
+
| `groupBy` + `alignBy` + `rollup` | 0.133 | 0.090 | 0.085 |
|
|
146
|
+
| `where` + `apply` + `sortBy`| 0.024 | 0.120 | 1.328 |
|
|
147
|
+
| `filterData` | 0.020 | 0.022 | 0.081 |
|
|
148
|
+
| `leftJoin` | 0.044 | 0.448 | 23.620 |
|
|
149
|
+
| `antiJoin` | 0.045 | 0.340 | 13.798 |
|
|
150
|
+
| `semiJoin` | 0.032 | 0.172 | 11.318 |
|
|
151
|
+
| `crossJoin` | 0.034 | 0.023 | — |
|
|
152
|
+
|
|
153
|
+
To run benchmarks locally:
|
|
154
|
+
|
|
155
|
+
```sh
|
|
156
|
+
bun run benchmark # print results to console
|
|
157
|
+
bun run benchmark:save # save results to benchmark/results/baseline.json
|
|
158
|
+
```
|
|
159
|
+
|
|
136
160
|
---
|
|
137
161
|
|
|
138
162
|
Part of [Rokkit](https://github.com/jerrythomas/rokkit) — a Svelte 5 component library and design system.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rokkit/data",
|
|
3
|
-
"version": "1.0.0-next.
|
|
3
|
+
"version": "1.0.0-next.152",
|
|
4
4
|
"description": "Contains generic data manipulation functions that can be used in various components.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -16,7 +16,9 @@
|
|
|
16
16
|
"prepublishOnly": "cp ../../LICENSE . && tsc --project tsconfig.build.json",
|
|
17
17
|
"postpublish": "rm -f LICENSE",
|
|
18
18
|
"clean": "rm -rf dist",
|
|
19
|
-
"build": "bun clean && bun prepublishOnly"
|
|
19
|
+
"build": "bun clean && bun prepublishOnly",
|
|
20
|
+
"benchmark": "bun benchmark/index.js",
|
|
21
|
+
"benchmark:save": "bun benchmark/index.js --save"
|
|
20
22
|
},
|
|
21
23
|
"files": [
|
|
22
24
|
"src/**/*.js",
|
package/src/dataset.js
CHANGED
|
@@ -54,11 +54,7 @@ function cloneConfig(config) {
|
|
|
54
54
|
*/
|
|
55
55
|
function summarize(config, from, using) {
|
|
56
56
|
const mapper =
|
|
57
|
-
typeof from === 'function'
|
|
58
|
-
? from
|
|
59
|
-
: Array.isArray(from)
|
|
60
|
-
? pickKeys(from)
|
|
61
|
-
: pickKeys([from])
|
|
57
|
+
typeof from === 'function' ? from : Array.isArray(from) ? pickKeys(from) : pickKeys([from])
|
|
62
58
|
const reducers = []
|
|
63
59
|
|
|
64
60
|
if (typeof using === 'string') reducers.push({ field: using, formula: (x) => x })
|