Skip to content

Commit e6c3f57

Browse files
authored
Merge pull request #11 from huttotw/feature/performance
feature/performance
2 parents a65eb98 + b4657cd commit e6c3f57

File tree

7 files changed

+294
-172
lines changed

7 files changed

+294
-172
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.idea

README.md

+21-14
Original file line numberDiff line numberDiff line change
@@ -64,26 +64,33 @@ res := e.Evaluate(props)
6464

6565
|Benchmark|N|Speed|Used|Allocs|
6666
|---------|----------|-----|------|------|
67-
|BenchmarkEqual-8|1000000000|7.26 ns/op|0 B/op|0 allocs/op|
68-
BenchmarkNotEqual-8|1000000000|4.95 ns/op|0 B/op|0 allocs/op|
69-
BenchmarkLessThan-8|500000000|10.9 ns/op|0 B/op|0 allocs/op|
70-
BenchmarkLessThanEqual-8|1000000000|7.79 ns/op|0 B/op|0 allocs/op|
71-
BenchmarkGreaterThan-8|200000000|18.1 ns/op|0 B/op|0 allocs/op|
72-
BenchmarkGreaterThanEqual-8|300000000|13.9 ns/op|0 B/op|0 allocs/op|
73-
BenchmarkContains-8|50000000|73.0 ns/op|64 B/op|2 allocs/op|
74-
BenchmarkContainsLong50000-8|100000000|55.6 ns/op|32 B/op|1 allocs/op|
75-
BenchmarkNotContains-8|50000000|75.1 ns/op|64 B/op|2 allocs/op|
76-
BenchmarkNotContainsLong50000-8|100000000|56.2 ns/op|32 B/op|1 allocs/op|
77-
BenchmarkOneOf|50000000|70.5 ns/op|64 B/op|2 allocs/op|
78-
BenchmarkNoneOf|100000000|71.7 ns/op|64 B/op|2 allocs/op|
79-
BenchmarkPluckShallow-8|100000000|60.2 ns/op|16 B/op|1 allocs/op|
80-
BenchmarkPluckDeep-8|20000000|242 ns/op|112 B/op|1 allocs/op|
67+
|BenchmarkEqual-12|1000000000|5.22 ns/op|0 B/op|0 allocs/op|
68+
|BenchmarkNotEqual-12|2000000000|3.77 ns/op|0 B/op|0 allocs/op|
69+
|BenchmarkLessThan-12|2000000000|2.20 ns/op|0 B/op|0 allocs/op|
70+
|BenchmarkLessThanEqual-12|2000000000|1.95 ns/op|0 B/op|0 allocs/op|
71+
|BenchmarkGreaterThan-12|5000000000|1.95 ns/op|0 B/op|0 allocs/op|
72+
|BenchmarkGreaterThanEqual-12|2000000000|1.97 ns/op|0 B/op|0 allocs/op|
73+
|BenchmarkContains-12|1000000000|5.66 ns/op|0 B/op|0 allocs/op|
74+
|BenchmarkContainsLong50000-12|30000|157679 ns/op|0 B/op|0 allocs/op|
75+
|BenchmarkNotContains-12|500000000|11.5 ns/op|0 B/op|0 allocs/op|
76+
|BenchmarkNotContainsLong50000-12|30000|157437 ns/op|0 B/op|0 allocs/op|
77+
|BenchmarkOneOf-12|500000000|11.0 ns/op|0 B/op|0 allocs/op|
78+
|BenchmarkNoneOf-12|500000000|10.7 ns/op|0 B/op|0 allocs/op|
79+
|BenchmarkPluckShallow-12|100000000|42.4 ns/op|16 B/op|1 allocs/op|
80+
|BenchmarkPluckDeep-12|30000000|174 ns/op|112 B/op|1 allocs/op|
81+
|BenchmarkRule_evaluate-12|100000000|51.7 ns/op|16 B/op|1 allocs/op|
82+
|BenchmarkComposite_evaluate-12|100000000|58.9 ns/op|16 B/op|1 allocs/op|
83+
|BenchmarkEngine_Evaluate-12|100000000|69.9 ns/op|16 B/op|1 allocs/op|
8184

8285
To run benchmarks:
8386
```
8487
go test -run none -bench . -benchtime 3s -benchmem
8588
```
8689

90+
All benchmarks were run on:
91+
92+
MacOS High Sierra 2.6Ghz Intel Core i7 16 GB 2400 MHz DDR4
93+
8794
# License
8895

8996
Copyright © 2018 Trevor Hutto

0 commit comments

Comments
 (0)