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

Auto memoization, "Share" button on wasm/online #86

Merged
merged 12 commits into from
Aug 2, 2024
Merged

Conversation

ldemailly
Copy link
Member

@ldemailly ldemailly commented Aug 2, 2024

Fixes #72

before

BenchmarkGrol/Fibonacci-10.gr-11         	    7478	    155847 ns/op	  130851 B/op	    6502 allocs/op
BenchmarkGrol/Fibonacci-35.gr-11         	       1	26592782750 ns/op	22056347384 B/op	1096181911 allocs/op

after

BenchmarkGrol/Fibonacci-10.gr-11         	   83880	     14579 ns/op	   13966 B/op	     559 allocs/op
BenchmarkGrol/Fibonacci-35.gr-11         	   24448	     48817 ns/op	   52861 B/op	    1834 allocs/op
  • handle print

We handle print by capturing and saving the output - we exclude log() even in "EvalString" (wasm/discord) mode
so log will show real execution while print will work like expected if there was no memoization

  • semi unrelated but added Share button, best used after checking "compact" and run, then share for a short url with the function

@ldemailly ldemailly marked this pull request as ready for review August 2, 2024 04:28
@ldemailly ldemailly changed the title Auto memoization Auto memoization, "Share" button on wasm/online Aug 2, 2024
@ldemailly ldemailly merged commit 1124530 into main Aug 2, 2024
1 check passed
@ldemailly ldemailly deleted the auto_memo branch August 2, 2024 07:35
@ldemailly ldemailly mentioned this pull request Aug 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

auto memoize all pure functions
1 participant