aboutsummaryrefslogtreecommitdiffstats
path: root/prog/prio_test.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2021-01-05 10:35:30 +0100
committerDmitry Vyukov <dvyukov@google.com>2021-01-05 11:15:55 +0100
commit270cde8ebe422a3197eec97faf00d3f10b0b0148 (patch)
tree3b534453949994c2a17ba6a02a2b0ee07cebd792 /prog/prio_test.go
parenta0234d980eccaa87f5821ac8e95ed9c94a104acf (diff)
prog: make priority calculation faster
Switch from float32 to int32. Float32 is super slow in arm emulation. Plus flats are generally non-deterministic due to order of operations, so we needed to do additional sorts to deal with that. Now we don't.
Diffstat (limited to 'prog/prio_test.go')
-rw-r--r--prog/prio_test.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/prog/prio_test.go b/prog/prio_test.go
index 902dbf3d4..21eb7f147 100644
--- a/prog/prio_test.go
+++ b/prog/prio_test.go
@@ -10,15 +10,15 @@ import (
)
func TestNormalizePrio(t *testing.T) {
- prios := [][]float32{
+ prios := [][]int32{
{2, 2, 2},
{1, 2, 4},
{1, 2, 0},
}
- want := [][]float32{
- {1, 1, 1},
- {0.1, 0.4, 1},
- {0.4, 1, 0.1},
+ want := [][]int32{
+ {1000, 1000, 1000},
+ {257, 505, 1000},
+ {505, 1000, 10},
}
t.Logf("had: %+v", prios)
normalizePrio(prios)