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

Implement our runtime with github.com/tetratelabs/wazero #2585

Closed
qdm12 opened this issue Jun 6, 2022 · 7 comments · Fixed by #3279 or #3352
Closed

Implement our runtime with github.com/tetratelabs/wazero #2585

qdm12 opened this issue Jun 6, 2022 · 7 comments · Fixed by #3279 or #3352

Comments

@qdm12
Copy link
Contributor

qdm12 commented Jun 6, 2022

Task summary

  1. Implement the same functionality as wasmer with wazero in lib/runtime
  2. Remove the lib/runtime/wasmer implementation

This is likely at least one week of work since all the code lib/runtime has to be modified, and tests adapted to work with wazero without cgo.

Outcomes

  1. Faster debugging: no more CGO, so no more weird unknown pc pointer stack traces
  2. Less dependencies: no need for glibc and libwasmer.so
  3. Faster Go compilation
  4. Lighter Docker images since we can now have alpine based or scratch based Docker images

Other information and links

  • Performance wise, I do not think it would matter if it's slower. Our performance should be mostly hit by the scale codec code.
@danforbes
Copy link
Contributor

Should this replace #1268?

@qdm12
Copy link
Contributor Author

qdm12 commented Jul 7, 2022

What do you think @timwu20 ?

Personally I would rather have a single Go runtime to throw out CGO, but we could also have different binaries/different build tags to have a fully Go version and a CGO one. 🤔

@danforbes
Copy link
Contributor

What is the benefit of offering both options? When would someone ever want to select the CGO option?

@qdm12
Copy link
Contributor Author

qdm12 commented Jul 11, 2022

I'd say it's unclear for now, but maybe one runtime uses less or more resources. I'd say we can take the decision to 'prune' wasmer once wazero is implemented if it's superior/close enough in terms of performance.

@qdm12 qdm12 changed the title Implement our runtime with [wazero](https://github.com/tetratelabs/wazero) Implement our runtime with github.com/tetratelabs/wazero Jul 11, 2022
@codefromthecrypt
Copy link

ooops put our notes on the wrong issue #2749 (comment)

ps we owe a huge page on the issues on CGO, though not all are obvious at first. Some will want to avoid it for docker alone, not just smaller but a lot simpler vs tracking shared libs etc https://gist.github.com/codefromthecrypt/edb33284354d592dc6056b9b7263872f

@qdm12
Copy link
Contributor Author

qdm12 commented Sep 9, 2022

Thanks @codefromthecrypt
We are well aware of CGO problems, and wazero looks like the best solution for Go (CGO or not).

Not only wasmer/cgo has production disadvantages, but it's also a pain in terms of development (notably unreadable panic messages instead of native Go panics when a Go nil pointer not even touching CGO is dereferenced, devs are forced to use glibc OSes with C libraries).

Anyway hoping to do this migration soon! #2749 got merged so one step closer! 👍

Copy link

🎉 This issue has been resolved in version 0.8.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants