Skip to content
Snippets Groups Projects
Commit 4bd3943c authored by STEVAN Antoine's avatar STEVAN Antoine :crab:
Browse files

improve setup and commit plots (dragoon/komodo!152)

- show the log of the degree for high values
- don't show the "time" Y label because the units are in the times
  values
- don't rotate the X tick labels

## results
![setup](/uploads/75dfd2033801a88e446e0ce8cae24167/setup.png)
![commit](/uploads/cca5bdfabb8f4242d21bf68079a5566a/commit.png)
parent 414c94fa
No related branches found
No related tags found
No related merge requests found
...@@ -5,11 +5,12 @@ use ../../../.nushell plot [ into-axis-options, COMMON_OPTIONS, gplt ] ...@@ -5,11 +5,12 @@ use ../../../.nushell plot [ into-axis-options, COMMON_OPTIONS, gplt ]
export def main [data: path, --save: path] { export def main [data: path, --save: path] {
check-file $data --span (metadata $data).span check-file $data --span (metadata $data).span
let graphs = open $data let raw = open $data
| where name !~ '^SEC' | where name !~ '^SEC'
| ns-to-ms $.times | ns-to-ms $.times
| compute-stats $.times | compute-stats $.times
| insert degree { get label | parse "degree {d}" | into record | get d | into int } | insert degree { get label | parse "degree {d}" | into record | get d | into int }
let graphs = $raw
| rename --column { degree: "x", mean: "y", stddev: "e" } | rename --column { degree: "x", mean: "y", stddev: "e" }
| select name x y e | select name x y e
| group-by name --to-table | group-by name --to-table
...@@ -19,11 +20,13 @@ export def main [data: path, --save: path] { ...@@ -19,11 +20,13 @@ export def main [data: path, --save: path] {
let options = [ let options = [
# --title "time to create trusted setups for certain curves" # --title "time to create trusted setups for certain curves"
--x-label "degree" --x-label '$\log_2 d$'
--y-label "time (in ms)" # --y-label "time"
...($graphs.points | flatten | into-axis-options -x "plain" -y "duration") ...($graphs.points | flatten | into-axis-options -x "plain" -y "duration")
...$COMMON_OPTIONS ...$COMMON_OPTIONS
(if $save != null { [ --save $save ] }) (if $save != null { [ --save $save ] })
--x-tick-labels ($raw.degree | uniq | math log 2)
--x-ticks-rotation 0
] ]
gplt plot ($graphs | to json) ...($options | flatten | compact) gplt plot ($graphs | to json) ...($options | flatten | compact)
......
...@@ -5,16 +5,17 @@ use ../../../.nushell plot [ into-axis-options, COMMON_OPTIONS, gplt ] ...@@ -5,16 +5,17 @@ use ../../../.nushell plot [ into-axis-options, COMMON_OPTIONS, gplt ]
export def main [data: path, --save: path] { export def main [data: path, --save: path] {
check-file $data --span (metadata $data).span check-file $data --span (metadata $data).span
let graphs = open $data let raw = open $data
| ns-to-ms times | ns-to-ms times
| compute-stats times | compute-stats times
| insert degree { get label | parse "degree {d}" | into record | get d | into int} | insert degree { get label | parse "degree {d}" | into record | get d | into int }
| update name {|it| if ($it.name | str starts-with "ARK") { | update name {|it| if ($it.name | str starts-with "ARK") {
let c = $it.name | parse "ARK setup on {curve}" | into record | get curve let c = $it.name | parse "ARK setup on {curve}" | into record | get curve
$"($c)-ark" $"($c)-ark"
} else { } else {
$it.name | parse "setup on {curve}" | into record | get curve $it.name | parse "setup on {curve}" | into record | get curve
}} }}
let graphs = $raw
| rename --column { degree: "x", mean: "y", stddev: "e" } | rename --column { degree: "x", mean: "y", stddev: "e" }
| select name x y e | select name x y e
| group-by name --to-table | group-by name --to-table
...@@ -24,11 +25,13 @@ export def main [data: path, --save: path] { ...@@ -24,11 +25,13 @@ export def main [data: path, --save: path] {
let options = [ let options = [
# --title "time to create trusted setups for certain curves" # --title "time to create trusted setups for certain curves"
--x-label "degree" --x-label '$\log_2 d$'
--y-label "time (in ms)" # --y-label "time"
...($graphs.points | flatten | into-axis-options -x "plain" -y "duration") ...($graphs.points | flatten | into-axis-options -x "plain" -y "duration")
...$COMMON_OPTIONS ...$COMMON_OPTIONS
(if $save != null { [ --save $save ] }) (if $save != null { [ --save $save ] })
--x-tick-labels ($raw.degree | uniq | math log 2)
--x-ticks-rotation 0
] ]
gplt plot ($graphs | to json) ...($options | flatten | compact) gplt plot ($graphs | to json) ...($options | flatten | compact)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment