Switch to faster json library go-json and sonic

Former-commit-id: ab9b4723f1dcf79fe5c073fff4d86f4f6969edfd
This commit is contained in:
Eric Coissac
2024-06-23 00:36:08 +02:00
parent 93f9dcb95f
commit c1f03cb1f6
9 changed files with 80 additions and 32 deletions

View File

@@ -1,12 +1,19 @@
package obialign
import "slices"
import (
log "github.com/sirupsen/logrus"
"slices"
)
func _Backtracking(pathMatrix []int, lseqA, lseqB int, path *[]int) []int {
needed := (lseqA + lseqB) * 2
(*path) = (*path)[:0]
cp := cap(*path)
(*path) = slices.Grow((*path), needed)
if cp < cap(*path) {
log.Infof("Resized path from %d to %d\n", cp, cap(*path))
}
p := cap(*path)
*path = (*path)[:p]
@@ -88,7 +95,5 @@ func _Backtracking(pathMatrix []int, lseqA, lseqB int, path *[]int) []int {
(*path)[p] = 0
}
*path = (*path)[p:cap((*path))]
return *path
return (*path)[p:cap((*path))]
}