(Testing against trealla-go)
Previous version:
cpu: Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz
BenchmarkQuery
BenchmarkQuery-16 1837 678403 ns/op
BenchmarkRedo
BenchmarkRedo-16 4272 287292 ns/op
% caveat: add an extra line break to the input :-) | |
:- use_module(library(dcgs)). | |
:- use_module(library(pio)). | |
elves([N|Ns]) --> elf(N), elves(Ns). | |
elves([]) --> []. | |
elf(Calories) --> sum(Calories), nl. | |
sum(X) --> number(A), nl, sum(B), { X is A + B }. |
package main | |
import ( | |
"bufio" | |
"fmt" | |
"os" | |
"strings" | |
) | |
type Room struct { |
(Testing against trealla-go)
Previous version:
cpu: Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz
BenchmarkQuery
BenchmarkQuery-16 1837 678403 ns/op
BenchmarkRedo
BenchmarkRedo-16 4272 287292 ns/op
package trealla_test | |
import ( | |
"context" | |
"sync/atomic" | |
"testing" | |
"sync" | |
"github.com/trealla-prolog/go/trealla" |