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

guile: dynamic ffi (slow) #28

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

antler5
Copy link

@antler5 antler5 commented May 15, 2022

Hi! This pull isn't merge-worthy quite yet, and I don't know that I'll come back to it tomorrow, but I wanted to be sure to leave what I have in case anyone else has any insights.

I first implemented this as shown on the guile_concise branch, and then again with a dedicated extension and the extra boilerplate needed to compile it, in the naive hope that would speed it up, but I just don't know what I'm doing :p

Here are the results I get (with the tool-chains that I bothered to setup, am on GuixSD):

The results are elapsed time in milliseconds
============================================
luajit:
2283
2260
c:
3117
3093
cpp:
3092
3155
guile:
564329000 # ⎤ concise branch
464285000 # ⎦
354308000 # ⎤ extension branch
562453000 # ⎦
haskell:
3179
3141
node:
18180
17727
go:
76953
76586
julia:
4013
2239

Yeah, yikes, that can't be right. Maybe I'm measuring nanoseconds wrong? It went through a few drafts, but was always putting out a few figures more than I'd like., and really does take 10-15 seconds. I tried profiling it with statprof, but it's all too far down in plusone. I could try enabling some extra compiler optimizations (defaults to level 2 out of 9)?

What's missing:

  • Why so slow???
  • Readme updates
  • Testing with upstream's configuration
  • Guile auto-compiles .scm files on first-run, so it probably doesn't even need handled in the Tupfile for the concise branch. We could stick a shebang on guile/hello.scm, chmod +x, and simplify the call in run-all.sh to ./gulie/hello.scm, too, but I'm not cleaning up until I've gotten to the bottom the order-of-magnitude speed difference I'm seeing.

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.

1 participant