awalterschulze / gominikanren

a Go implementation of miniKanren, an embedded Domain Specific Language for logic programming.
Other
38 stars 2 forks source link

Streams #27

Closed awalterschulze closed 1 year ago

awalterschulze commented 1 year ago

optimize channels by passing them in as a parameter This way each goal doesn't have to create a new channel and a go routine.

The fibonacci benchmark now actually finishes

BenchmarkFib10Co BenchmarkFib10Co-10 60 20424819 ns/op BenchmarkFib15Co BenchmarkFib15Co-10 1 3072811084 ns/op

still much slower than the sequential, but no only less than ten times slower

BenchmarkFib10Seq BenchmarkFib10Seq-10 307 3804502 ns/op BenchmarkFib15Seq BenchmarkFib15Seq-10 2 874973875 ns/op

This also meant I had to remove Cons, Zzz and Suspend and all tests related to that.