buildfoundation / ketolang

Future of general purpose Сonfiguration languages. Side-effect-less dialect of Kotlin.
Apache License 2.0
81 stars 1 forks source link

Implement basic function memoization #28

Closed artem-zinnatullin closed 2 years ago

artem-zinnatullin commented 2 years ago

Told ya imma do it.

# not memoized
❯ java -cp samples/cli/build/libs/cli-all.jar com.pushtorefresh.ketolang.sample.MainKt                  
fibonacci(n=48) == 512559680, took 12.140489459s                                                                                      

# memoized
❯ java -cp samples/cli/build/libs/cli-all/Archive.jar com.pushtorefresh.ketolang.sample.MainKt    
fibonacci(n=48) == 512559680, took 3.766708ms