Skip to content

guile: dynamic ffi (slow)#28

Open
antler5 wants to merge 1 commit intodyu:masterfrom
antler5:guile_concise
Open

guile: dynamic ffi (slow)#28
antler5 wants to merge 1 commit intodyu:masterfrom
antler5:guile_concise

Conversation

@antler5
Copy link
Copy Markdown

@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