diff --git a/TODO.txt b/TODO.txt index 7bd49dfd..e1b093ea 100644 --- a/TODO.txt +++ b/TODO.txt @@ -1,6 +1,5 @@ # TODO -* Vertical spacing in charts not working for all scorekeepers ? Drop-down for scoring ... line between regular scores and tilde versions? - no nested drop-downs w/o js/css * diff --git a/docs/scores/~Dedup/0/chart.svg b/docs/scores/~Dedup/0/chart.svg deleted file mode 100644 index 12b4908d..00000000 --- a/docs/scores/~Dedup/0/chart.svg +++ /dev/null @@ -1,148 +0,0 @@ -\n0102030405060708090100Warnings0102030405060708090100Benchmarks0.000.000.000.000.000.000.000.000.000.000.000.000.000.000.003/4HalfQuarterslog/JSONHandlersnqk/meldveqryn/dedup/Overwriteveqryn/dedup/Ignoreveqryn/dedup/Appendveqryn/dedup/Increment \ No newline at end of file diff --git a/docs/scores/~Dedup/1/chart.svg b/docs/scores/~Dedup/1/chart.svg deleted file mode 100644 index 5da51b19..00000000 --- a/docs/scores/~Dedup/1/chart.svg +++ /dev/null @@ -1,132 +0,0 @@ -\n2530405060708090100Warnings2530405060708090100Benchmarks0.000.000.000.000.000.000.000.000.000.000.000.000.000.000.00HalfQuarterslog/JSONHandlersnqk/meldveqryn/dedup/Overwriteveqryn/dedup/Ignoreveqryn/dedup/Appendveqryn/dedup/Increment \ No newline at end of file diff --git a/docs/scores/~Dedup/2/chart.svg b/docs/scores/~Dedup/2/chart.svg deleted file mode 100644 index e8aaf32a..00000000 --- a/docs/scores/~Dedup/2/chart.svg +++ /dev/null @@ -1,132 +0,0 @@ -\n50556065707580859095100Warnings50556065707580859095100Benchmarks0.000.000.000.000.000.000.000.000.000.000.000.000.000.000.00Quarterslog/JSONHandlersnqk/meldveqryn/dedup/Overwriteveqryn/dedup/Ignoreveqryn/dedup/Appendveqryn/dedup/Increment \ No newline at end of file diff --git a/docs/scores/~Dedup/3/chart.svg b/docs/scores/~Dedup/3/chart.svg deleted file mode 100644 index b8e14f15..00000000 --- a/docs/scores/~Dedup/3/chart.svg +++ /dev/null @@ -1,108 +0,0 @@ -\n75767880828486889092949698100Warnings75767880828486889092949698100Benchmarks0.000.000.000.000.000.000.000.000.000.000.000.000.000.000.00slog/JSONHandlersnqk/meld \ No newline at end of file diff --git a/docs/scores/~Dedup/summary.html b/docs/scores/~Dedup/summary.html deleted file mode 100644 index 24f713bc..00000000 --- a/docs/scores/~Dedup/summary.html +++ /dev/null @@ -1,467 +0,0 @@ - - - Handler Scores - - - - - -
-
- - - - - - -
- - Home - -

Handler Scores

-
- - - - - - - - - - - - - - - - - - - -
Handlers -
- -
-
Bench Tests -
- -
-
Verify Tests -
- -
-
-
- -
-
-
- -
-
-
- -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Scores

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
HandlerWarningsBenchmarks
slog/JSONHandler98.4796.80
snqk/meld100.0087.03
veqryn/dedup/Append98.4753.11
veqryn/dedup/Ignore98.4755.45
veqryn/dedup/Increment98.4752.88
veqryn/dedup/Overwrite100.0055.48
-

- Numbers are on scale of 0..100. - Metrics algorithms completely made up out of thin air. - See notes below for details. -

-

Speed vs. Functionality

- - - - - - - - - - - - - - -
- - ← Chart Size → - Top Right: - - - -
- Handler Scoring - Handler Scoring - Handler Scoring - Handler Scoring -
-

- Higher numbers are better on both axes. The "good" zone is the upper right and the "bad" zone is the lower left.
- The top is fast, the bottom is slow. Left is more warnings, right is less.

-

-

Scoring Algorithms

-
-

The algorithms behind the scores shown on this page are somewhat arbitrary. -The original scoring algorithm (Default) was deemed "good enough", -but later work has focused on enabling multiple scoring algorithms. -These can be found on the Home page or -in the Scoring drop-down in the upper right section of every page.

- -

Algorithms are implemented by "scorekeepers". -Each scorekeeper is specified by the two axes shown in the scoring chart.

- -

The current scorekeeper algorithm is described below:

- -

-

Score Keeper: ~Dedup

-

The Dedup scoring algorithm is the same as the Default algorithm.

- -

The chart compares the behavior of the slog/JSONHandler handler -to available wrappers that de-duplicate fields in the result.

- -

-

X Axis: Warnings

-

The X-axis for the default scoring chart shows the score derived from verification warnings.

- -

The generated warnings are weighted according to the table to the right -which are applied to the warning levels for the generated warnings.

- -
- - - - - - - - - - - - - - - - - - - - - - - -
LevelWeight
Required8
Implied4
Suggested2
Administrative1
- - -

-

Y Axis: Benchmarks

-

The Y-axis for the default scoring chart shows the score derived from running benchmarks.

- -

The score is calculated using the score weights shown to the right -which are applied to the several specific benchmark result values.

- -
- - - - - - - - - - - - - - - - - - - -
DataWeight
Nanoseconds3
Alloc Bytes2
Allocations1
- - -
-
-
- -
- - - diff --git a/docs/scores/~ReplAttr/0/chart.svg b/docs/scores/~ReplAttr/0/chart.svg deleted file mode 100644 index 9f1fd50b..00000000 --- a/docs/scores/~ReplAttr/0/chart.svg +++ /dev/null @@ -1,120 +0,0 @@ -\n0102030405060708090100Warnings0102030405060708090100Benchmarks0.000.000.000.000.000.000.000.000.000.000.000.000.000.000.003/4HalfQuartermadkins/flashmadkins/replattr \ No newline at end of file diff --git a/docs/scores/~ReplAttr/1/chart.svg b/docs/scores/~ReplAttr/1/chart.svg deleted file mode 100644 index d2073497..00000000 --- a/docs/scores/~ReplAttr/1/chart.svg +++ /dev/null @@ -1,104 +0,0 @@ -\n2530405060708090100Warnings2530405060708090100Benchmarks0.000.000.000.000.000.000.000.000.000.000.000.000.000.000.00HalfQuartermadkins/flashmadkins/replattr \ No newline at end of file diff --git a/docs/scores/~ReplAttr/2/chart.svg b/docs/scores/~ReplAttr/2/chart.svg deleted file mode 100644 index e8608502..00000000 --- a/docs/scores/~ReplAttr/2/chart.svg +++ /dev/null @@ -1,104 +0,0 @@ -\n50556065707580859095100Warnings50556065707580859095100Benchmarks0.000.000.000.000.000.000.000.000.000.000.000.000.000.000.00Quartermadkins/flashmadkins/replattr \ No newline at end of file diff --git a/docs/scores/~ReplAttr/3/chart.svg b/docs/scores/~ReplAttr/3/chart.svg deleted file mode 100644 index 97ffb478..00000000 --- a/docs/scores/~ReplAttr/3/chart.svg +++ /dev/null @@ -1,108 +0,0 @@ -\n75767880828486889092949698100Warnings75767880828486889092949698100Benchmarks0.000.000.000.000.000.000.000.000.000.000.000.000.000.000.00madkins/flashmadkins/replattr \ No newline at end of file diff --git a/docs/scores/~ReplAttr/summary.html b/docs/scores/~ReplAttr/summary.html deleted file mode 100644 index dba13030..00000000 --- a/docs/scores/~ReplAttr/summary.html +++ /dev/null @@ -1,447 +0,0 @@ - - - Handler Scores - - - - - -
-
- - - - - - -
- - Home - -

Handler Scores

-
- - - - - - - - - - - - - - - - - - - -
Handlers -
- -
-
Bench Tests -
- -
-
Verify Tests -
- -
-
-
- -
-
-
- -
-
-
- -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Scores

- - - - - - - - - - - - - - - - - - - -
HandlerWarningsBenchmarks
madkins/flash98.4795.70
madkins/replattr98.4793.83
-

- Numbers are on scale of 0..100. - Metrics algorithms completely made up out of thin air. - See notes below for details. -

-

Speed vs. Functionality

- - - - - - - - - - - - - - -
- - ← Chart Size → - Top Right: - - - -
- Handler Scoring - Handler Scoring - Handler Scoring - Handler Scoring -
-

- Higher numbers are better on both axes. The "good" zone is the upper right and the "bad" zone is the lower left.
- The top is fast, the bottom is slow. Left is more warnings, right is less.

-

-

Scoring Algorithms

-
-

The algorithms behind the scores shown on this page are somewhat arbitrary. -The original scoring algorithm (Default) was deemed "good enough", -but later work has focused on enabling multiple scoring algorithms. -These can be found on the Home page or -in the Scoring drop-down in the upper right section of every page.

- -

Algorithms are implemented by "scorekeepers". -Each scorekeeper is specified by the two axes shown in the scoring chart.

- -

The current scorekeeper algorithm is described below:

- -

-

Score Keeper: ~ReplAttr

-

The ReplAttr scoring algorithm is the same as the Default algorithm.

- -

The chart compares the behavior of the madkins/flash handler -configured with both flash.Extras customization -(to mimic a badly behaved handler) and -a set of ReplaceAttr functions to remove that customization. -The goal is to compare the performance with and without -the ReplaceAttr functions defined in this repository.

- -

-

X Axis: Warnings

-

The X-axis for the default scoring chart shows the score derived from verification warnings.

- -

The generated warnings are weighted according to the table to the right -which are applied to the warning levels for the generated warnings.

- -
- - - - - - - - - - - - - - - - - - - - - - - -
LevelWeight
Required8
Implied4
Suggested2
Administrative1
- - -

-

Y Axis: Benchmarks

-

The Y-axis for the default scoring chart shows the score derived from running benchmarks.

- -

The score is calculated using the score weights shown to the right -which are applied to the several specific benchmark result values.

- -
- - - - - - - - - - - - - - - - - - - -
DataWeight
Nanoseconds3
Alloc Bytes2
Allocations1
- - -
-
-
- -
- - - diff --git a/internal/scoring/keeper/singular.go b/internal/scoring/keeper/dedup.go similarity index 96% rename from internal/scoring/keeper/singular.go rename to internal/scoring/keeper/dedup.go index c26f7836..22d2e561 100644 --- a/internal/scoring/keeper/singular.go +++ b/internal/scoring/keeper/dedup.go @@ -9,7 +9,7 @@ import ( "github.com/madkins23/go-slog/internal/scoring/score" ) -const SingleName = "~Dedup" +const SingleName = ":Dedup" var ( //go:embed doc/dedup-doc.md diff --git a/internal/scoring/keeper/replattr.go b/internal/scoring/keeper/replattr.go index 96d958a5..40f01904 100644 --- a/internal/scoring/keeper/replattr.go +++ b/internal/scoring/keeper/replattr.go @@ -9,7 +9,7 @@ import ( "github.com/madkins23/go-slog/internal/scoring/score" ) -const ReplAttrName = "~ReplAttr" +const ReplAttrName = ":ReplAttr" var ( //go:embed doc/repl-attr-doc.md diff --git a/internal/scoring/score/keeper.go b/internal/scoring/score/keeper.go index 8e9b1521..7e3a1fd8 100644 --- a/internal/scoring/score/keeper.go +++ b/internal/scoring/score/keeper.go @@ -142,6 +142,8 @@ func GetKeeper(tag KeeperTag) *Keeper { return keepers[tag] } +const specialChar = ':' + func Keepers() []KeeperTag { if keeperTags == nil { keeperTags = make([]KeeperTag, 0, len(keepers)) @@ -149,6 +151,13 @@ func Keepers() []KeeperTag { keeperTags = append(keeperTags, tag) } sort.Slice(keeperTags, func(i, j int) bool { + if keeperTags[i][0] == specialChar { + if keeperTags[j][0] != specialChar { + return false + } + } else if keeperTags[j][0] == specialChar { + return true + } return keeperTags[i] < keeperTags[j] }) }