Skip to content

Commit a66fffd

Browse files
authored
Merge pull request #3 from harpratap/openness
add benchmarks for open defintions
2 parents 0d386e2 + 4ab5b9e commit a66fffd

File tree

4 files changed

+492
-0
lines changed

4 files changed

+492
-0
lines changed

Diff for: README.md

+16
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,20 @@ BenchmarkConjunctionDouble-16 17859 335044 ns/op
3939
BenchmarkConjunctionSingle-16 19837 287302 ns/op
4040
PASS
4141
ok github.com/harpratap/cue-perf-tests 25.784s
42+
```
43+
44+
## 3. Openness
45+
46+
Definitions are by default closed, but adding ellipses `...` will open them. When importing OpenAPI spec to CUE it defaults to open definitions, which will cause export times to slow down
47+
48+
```
49+
go test -bench=BenchmarkDefinition
50+
goos: darwin
51+
goarch: amd64
52+
pkg: github.com/harpratap/cue-perf-tests
53+
cpu: Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
54+
BenchmarkDefinitionOpen-16 1404 800391 ns/op
55+
BenchmarkDefinitionClosed-16 1635 770721 ns/op
56+
PASS
57+
ok github.com/harpratap/cue-perf-tests 3.130s
4258
```

Diff for: main.go

+2
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,6 @@ func main() {
77
listComprehensionShort10()
88
conjunctionSingle()
99
conjunctionDouble()
10+
definitionOpen()
11+
defintionClosed()
1012
}

0 commit comments

Comments
 (0)