Dean Karn
589c2ad113
Merge pull request #217 from joeybloggs/v8-development
...
Add struct field + associated tags caching
9 years ago
joeybloggs
e019c28542
Add struct field + associated tags caching
...
* This essentially reduces the number of cache tag lookups for a structs fields to one.
9 years ago
joeybloggs
94182a2199
init struct cache changes
9 years ago
Dean Karn
638ea8a3f8
Merge pull request #216 from go-playground/v8-development
...
Micro optimization in Tag Cache
9 years ago
Dean Karn
d5987d5437
Merge pull request #215 from joeybloggs/v8-development
...
Micro optimization in Tag Cache
9 years ago
joeybloggs
b0bd08d7c8
Micro optimization in Tag Cache
...
Removed defer from the simple Tag Cache lock & unlock and reduced
execution time for even single field validation by almost 100ns
from 254ns/op to 163ns/op .. Not badd for such a simple modification
and this effect ripples throughout struct validation.
```go
$ go test -cpu=4 -bench=. -benchmem=true
PASS
BenchmarkFieldSuccess-4 10000000 163 ns/op 0 B/op 0 allocs/op
BenchmarkFieldFailure-4 2000000 673 ns/op 400 B/op 4 allocs/op
BenchmarkFieldDiveSuccess-4 500000 3019 ns/op 480 B/op 27 allocs/op
BenchmarkFieldDiveFailure-4 500000 3553 ns/op 880 B/op 31 allocs/op
BenchmarkFieldCustomTypeSuccess-4 5000000 347 ns/op 32 B/op 2 allocs/op
BenchmarkFieldCustomTypeFailure-4 2000000 645 ns/op 400 B/op 4 allocs/op
BenchmarkFieldOrTagSuccess-4 1000000 1177 ns/op 16 B/op 1 allocs/op
BenchmarkFieldOrTagFailure-4 1000000 1093 ns/op 432 B/op 6 allocs/op
BenchmarkStructLevelValidationSuccess-4 2000000 702 ns/op 160 B/op 6 allocs/op
BenchmarkStructLevelValidationFailure-4 1000000 1279 ns/op 592 B/op 11 allocs/op
BenchmarkStructSimpleCustomTypeSuccess-4 1000000 1010 ns/op 80 B/op 5 allocs/op
BenchmarkStructSimpleCustomTypeFailure-4 1000000 1544 ns/op 624 B/op 11 allocs/op
BenchmarkStructPartialSuccess-4 1000000 1249 ns/op 400 B/op 11 allocs/op
BenchmarkStructPartialFailure-4 1000000 1797 ns/op 816 B/op 16 allocs/op
BenchmarkStructExceptSuccess-4 2000000 927 ns/op 368 B/op 9 allocs/op
BenchmarkStructExceptFailure-4 1000000 1259 ns/op 400 B/op 11 allocs/op
BenchmarkStructSimpleCrossFieldSuccess-4 1000000 1076 ns/op 128 B/op 6 allocs/op
BenchmarkStructSimpleCrossFieldFailure-4 1000000 1623 ns/op 560 B/op 11 allocs/op
BenchmarkStructSimpleCrossStructCrossFieldSuccess-4 1000000 1582 ns/op 176 B/op 9 allocs/op
BenchmarkStructSimpleCrossStructCrossFieldFailure-4 1000000 2139 ns/op 608 B/op 14 allocs/op
BenchmarkStructSimpleSuccess-4 1000000 1040 ns/op 48 B/op 3 allocs/op
BenchmarkStructSimpleFailure-4 1000000 1683 ns/op 624 B/op 11 allocs/op
BenchmarkStructSimpleSuccessParallel-4 5000000 356 ns/op 48 B/op 3 allocs/op
BenchmarkStructSimpleFailureParallel-4 2000000 831 ns/op 624 B/op 11 allocs/op
BenchmarkStructComplexSuccess-4 200000 6738 ns/op 512 B/op 30 allocs/op
BenchmarkStructComplexFailure-4 200000 11387 ns/op 3415 B/op 72 allocs/op
BenchmarkStructComplexSuccessParallel-4 500000 2330 ns/op 512 B/op 30 allocs/op
BenchmarkStructComplexFailureParallel-4 300000 4857 ns/op 3416 B/op 72 allocs/op
```
```go
$ go test -cpu=4 -bench=. -benchmem=true
PASS
BenchmarkFieldSuccess-4 5000000 254 ns/op 0 B/op 0 allocs/op
BenchmarkFieldFailure-4 2000000 779 ns/op 400 B/op 4 allocs/op
BenchmarkFieldDiveSuccess-4 500000 3451 ns/op 480 B/op 27 allocs/op
BenchmarkFieldDiveFailure-4 300000 3954 ns/op 880 B/op 31 allocs/op
BenchmarkFieldCustomTypeSuccess-4 3000000 451 ns/op 32 B/op 2 allocs/op
BenchmarkFieldCustomTypeFailure-4 2000000 751 ns/op 400 B/op 4 allocs/op
BenchmarkFieldOrTagSuccess-4 1000000 1312 ns/op 16 B/op 1 allocs/op
BenchmarkFieldOrTagFailure-4 1000000 1206 ns/op 432 B/op 6 allocs/op
BenchmarkStructLevelValidationSuccess-4 2000000 829 ns/op 160 B/op 6 allocs/op
BenchmarkStructLevelValidationFailure-4 1000000 1403 ns/op 592 B/op 11 allocs/op
BenchmarkStructSimpleCustomTypeSuccess-4 1000000 1238 ns/op 80 B/op 5 allocs/op
BenchmarkStructSimpleCustomTypeFailure-4 1000000 1771 ns/op 624 B/op 11 allocs/op
BenchmarkStructPartialSuccess-4 1000000 1399 ns/op 400 B/op 11 allocs/op
BenchmarkStructPartialFailure-4 1000000 1926 ns/op 816 B/op 16 allocs/op
BenchmarkStructExceptSuccess-4 2000000 930 ns/op 368 B/op 9 allocs/op
BenchmarkStructExceptFailure-4 1000000 1381 ns/op 400 B/op 11 allocs/op
BenchmarkStructSimpleCrossFieldSuccess-4 1000000 1253 ns/op 128 B/op 6 allocs/op
BenchmarkStructSimpleCrossFieldFailure-4 1000000 1849 ns/op 560 B/op 11 allocs/op
BenchmarkStructSimpleCrossStructCrossFieldSuccess-4 1000000 1902 ns/op 176 B/op 9 allocs/op
BenchmarkStructSimpleCrossStructCrossFieldFailure-4 500000 2453 ns/op 608 B/op 14 allocs/op
BenchmarkStructSimpleSuccess-4 1000000 1182 ns/op 48 B/op 3 allocs/op
BenchmarkStructSimpleFailure-4 1000000 1842 ns/op 624 B/op 11 allocs/op
BenchmarkStructSimpleSuccessParallel-4 5000000 342 ns/op 48 B/op 3 allocs/op
BenchmarkStructSimpleFailureParallel-4 2000000 665 ns/op 624 B/op 11 allocs/op
BenchmarkStructComplexSuccess-4 200000 7924 ns/op 512 B/op 30 allocs/op
BenchmarkStructComplexFailure-4 100000 12605 ns/op 3415 B/op 72 allocs/op
BenchmarkStructComplexSuccessParallel-4 1000000 2421 ns/op 512 B/op 30 allocs/op
BenchmarkStructComplexFailureParallel-4 300000 4234 ns/op 3416 B/op 72 allocs/op
```
9 years ago
Dean Karn
ec28e2da37
Merge pull request #214 from go-playground/v8-development
...
Update benchmarks + correct benchmark error
9 years ago
Dean Karn
47c3cabf25
Merge pull request #213 from joeybloggs/v8-development
...
Update benchmarks + correct benchmark error
9 years ago
joeybloggs
d451d57023
Update benchmarks + correct benchmark error
...
* Fix error with BenchmarkFieldFailure, it was recording a successful
run.
* Update some benchmarks, they were showing allocations for the creation
of the data not just processing it.
9 years ago
Dean Karn
d776d3eb2e
Merge pull request #212 from go-playground/v8-development
...
Add minor optimization for structonly & nostructlevel checks
9 years ago
Dean Karn
ba623db026
Merge pull request #211 from joeybloggs/v8-development
...
Add minor optimization for structonly & nostructlevel checks
9 years ago
joeybloggs
41828a2d17
Merge remote-tracking branch 'upstream/v8' into v8-development
9 years ago
joeybloggs
cab69bdd13
Add minor optimization for structonly & nostructlevel checks
9 years ago
Dean Karn
82faf6f72a
Merge pull request #210 from go-playground/v8-development
...
Add nostructlevel tag
9 years ago
Dean Karn
aea222d51c
Merge pull request #209 from joeybloggs/v8-development
...
Add nostructlevel tag
9 years ago
joeybloggs
24c1c6819f
Add nostructlevel tag
...
* nostructlevel - Same as structonly tag except that any struct level
validations will not run.
9 years ago
Dean Karn
27557e4813
Merge pull request #208 from go-playground/v8-development
...
Fix issue with structOnly + struct level validation
9 years ago
Dean Karn
5ad5c12aab
Merge pull request #207 from joeybloggs/v8-development
...
Fix issue with structOnly + struct level validation
9 years ago
joeybloggs
59859969c6
Fix issue with structOnly + struct level validation
...
* Issue was that when "structonly" tag was set the struct
level validation wasn't running, this has been corrected.
9 years ago
Dean Karn
c5efdc9576
Merge pull request #206 from go-playground/v8-development
...
Added Helper method to Report errors from struct level.
9 years ago
Dean Karn
6268452877
Merge pull request #205 from joeybloggs/v8-development
...
Added Helper method to Report errors from struct level.
9 years ago
joeybloggs
29403404e4
Added Helper method to Report errors from struct level.
9 years ago
Dean Karn
2ecdb677b3
Merge pull request #204 from go-playground/v8-development
...
Merge Struct Level Validations
9 years ago
Dean Karn
885fd6cb97
Merge pull request #203 from joeybloggs/v8-development
...
Merge Struct Level Validations
9 years ago
joeybloggs
a48387a078
Merge remote-tracking branch 'upstream/v8-development' into v8-development
9 years ago
joeybloggs
f1acffdfe0
Add Struct Level Validation!
9 years ago
Dean Karn
5f64c229a4
Merge pull request #202 from go-playground/v8
...
Merge changes
9 years ago
Dean Karn
11b132ba0b
Update README.md
...
Add goreport badge
9 years ago
Dean Karn
a21885483f
Merge pull request #201 from go-playground/v8-development
...
Update Error message quotes to single quotes
9 years ago
Dean Karn
9a3b21ded0
Merge pull request #200 from joeybloggs/v8-development
...
Update Error message quotes to single quotes
9 years ago
joeybloggs
1570c9b6b3
Update Error message quotes to single quotes
...
* helps reduce noise when transmitting errors via JSON.
for #199
9 years ago
Dean Karn
d5305abfab
Merge pull request #197 from go-playground/v8-development
...
V8 development
9 years ago
Dean Karn
377e5e06a1
Merge pull request #196 from joeybloggs/v8-development
...
Exposed Baked In Validators
9 years ago
joeybloggs
fc5d9f3ae0
Exposed Baked In Validators
...
* Exposed for use within custom functions.
9 years ago
Dean Karn
247a19d4b0
Merge pull request #194 from go-playground/v8
...
Merge latest changes that got merge directly into v8
10 years ago
Dean Karn
17084684e6
Merge pull request #193 from krhubert/v8
...
add cidr, cidrv4 and cidrv6 validators
10 years ago
Hubert
d015334e09
fix docs usage for cidr validator
10 years ago
Hubert
9ffc753204
add cidr, cidrv4 and cidrv6 validators
...
- add validate functions
- add tests
- put validators as builtin in docs
10 years ago
Dean Karn
ea31d3ec23
Merge pull request #192 from fabioxgn/patch-1
...
Fix typo on README so the example compiles
10 years ago
Fábio Gomes
28b6964c53
Fix typo on README so the example compiles
10 years ago
Dean Karn
7bfad40793
Merge pull request #191 from go-playground/v8-development
...
V8 development
10 years ago
Dean Karn
e82c80a530
Merge pull request #190 from joeybloggs/v8-development
...
Merge changes for custom field name extraction
10 years ago
joeybloggs
46f4476335
Update README
10 years ago
joeybloggs
3cef97a452
minor speed improvements
...
* added check for "-" in custom field name
10 years ago
Dean Karn
344bcd6e10
Merge pull request #188 from ilgooz/fieldname
...
configurable field name support
10 years ago
İlker Göktuğ Öztürk
5bc0ff91f8
configurable field name support
10 years ago
Dean Karn
92ddaeb7d8
Merge pull request #185 from go-playground/v8-development
...
V8 development
10 years ago
Dean Karn
8818fdcf0b
Merge pull request #184 from joeybloggs/v8-development
...
update organization from bluesuncorp to go-playground
10 years ago
joeybloggs
c8fb9a5e7c
Merge remote-tracking branch 'upstream/v8' into v8-development
10 years ago
Dean Karn
5b7705b83f
Merge pull request #175 from joeybloggs/v8-development
...
Update for repo move
10 years ago