Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update benchmarks #2415

Merged
merged 3 commits into from
Sep 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/benchmark/combinations/runtime/combinations.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ static constr_info_t juvix_constr_info_array[CONSTRS_NUM] = {BUILTIN_UIDS_INFO};

int main() {
JUVIX_DECL_ARGS;
JUVIX_PROLOGUE(2);
JUVIX_PROLOGUE(3);

juvix_constrs_num = CONSTRS_NUM;
juvix_constr_info = juvix_constr_info_array;
Expand Down
25 changes: 13 additions & 12 deletions tests/benchmark/mapfun/juvix/mapfun.juvix
Original file line number Diff line number Diff line change
@@ -1,35 +1,36 @@
-- successively map K functions to a list of N integers
module mapfun;

import Stdlib.Prelude open;
import Stdlib.Data.Nat.Ord open;
import Stdlib.Prelude open hiding {+};
import Stdlib.Data.Int open;
import Stdlib.Data.Int.Ord open;

mapfun : {A : Type} → List (A → A) → List A → List A
| nil xs := xs
| (f :: fs) xs := mapfun fs (map f xs);

genfs : Nat → List (NatNat)
genfs : Nat → List (IntInt)
| zero := nil
| (suc n) := sub (suc n) :: genfs n;
| n@(suc n') := (-) (ofNat n) :: genfs n';

step : Nat → (NatNat) → NatNat
| n f x := f (x + n);
step : Nat → (IntInt) → IntInt
| n f x := f (x + ofNat n);

genffs : Nat → List ((NatNat) → NatNat)
genffs : Nat → List ((IntInt) → IntInt)
| zero := nil
| (suc n) := step (suc n) :: genffs n;

sum_go : Nat → List NatNat
sum_go : Int → List IntInt
| acc nil := acc
| acc (h :: t) := sum_go (acc + h) t;

sum : List NatNat := sum_go 0;
sum : List IntInt := sum_go 0;

terminating
gen : NatNat → List Nat
| k n := if (k == n) (k :: nil) (k :: gen (suc k) n);
gen : IntInt → List Int
| k n := if (k == n) (k :: nil) (k :: gen (k + 1) n);

main : IO :=
printNatLn
printIntLn
(sum
(mapfun (mapfun (genffs 100) (genfs 100)) (gen 1 10000)));
4 changes: 1 addition & 3 deletions tests/benchmark/maybe/juvix/maybe.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ gen : Nat → Tree

terminating
sum : Nat → Tree → Maybe Nat

| x leaf := just 0
| x (node y l r) :=
if (x == y) nothing (step1 x y (sum x l) r);
Expand All @@ -35,12 +34,11 @@ maybeStepRun : Nat → Nat → Maybe Nat
| x y := just (sub y x);

run : Nat → Tree → Maybe Nat

| zero t := sum 0 t
| (suc n) t := stepRun (suc n) t (run n t);

stepRun : Nat → Tree → Maybe Nat → Maybe Nat

| n t nothing := sum n t
| n t (just x) := maybe nothing (maybeStepRun x) (sum n t);

Expand Down
2 changes: 1 addition & 1 deletion tests/benchmark/maybe/runtime/maybe.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ static constr_info_t juvix_constr_info_array[CONSTRS_NUM] = {

int main() {
JUVIX_DECL_ARGS;
JUVIX_PROLOGUE(2);
JUVIX_PROLOGUE(3);

juvix_constrs_num = CONSTRS_NUM;
juvix_constr_info = juvix_constr_info_array;
Expand Down
1 change: 0 additions & 1 deletion tests/benchmark/mergesort/juvix/mergesort.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ merget : List Nat → List Nat → List Nat → List Nat

terminating
sort' : List Nat × List Nat → List Nat

| (l1, l2) := merget (sort l1) (sort l2) nil;

terminating
Expand Down