Coder Social home page Coder Social logo

Comments (4)

anuraaga avatar anuraaga commented on June 5, 2024

Hi @johnlanni - very sorry for the late reply. It was tough to respond since I was hoping to come up with a better response, I think in the end it's time to be clear.

There have been various memory leaks reported and fixed, but at a fundamental level without closer integration of Tinygo and bdwgc, I suspect creating an actually good GC will not be feasible.

Go is very close to supporting wasm exports

golang/go#65199

With that, almost any WASI binary compiled with Tinygo should be compilable with Go. For any production workload concerned with performance, it probably should switch to the official compiler. The GC is strongly tied to the compiler there and will perform much better than anything achievable with Tinygo at the tradeoff of large binaries.

I plan on archiving this repo as soon as wasmexport is available in gotip. I will leave this issue open since it is indeed an issue with this repo. But unfortunately it won't be addressed and my general suggestion for the Wasm ecosystem in Go is to pause until wasmexport is available in gotip.

from nottinygc.

johnlanni avatar johnlanni commented on June 5, 2024

Hi @anuraaga, thank you for the information and the work you have done in this repo to benefit us.
We currently work around this issue by identifying whether the http request/response is suitable for printable characters.
Another thing I want to ask is, even if gotip supports wasm export, how does it support gc?

from nottinygc.

anuraaga avatar anuraaga commented on June 5, 2024

@johnlanni I'm glad to hear that printable responses still work well. I wish I knew why 😂

When using the Go compiler with GOOS=wasip1, the runtime is the same as Go. It means it is the exact Go GC we enjoy with normal Go programs. Go has long supported single core operation so the GC is well designed for it and seems to work quite well. With wasmexport, we will need to benchmark again to see how well it performs with Envoy but I expect it to be much better than the workaround in this repo.

from nottinygc.

johnlanni avatar johnlanni commented on June 5, 2024

Based on my understanding of Go's native GC, the GC process is parallel to the execution of user code. It does not perform GC during the memory allocation process like bdwgc. Wasm does not support multi-threading. How does Go's native GC achieve this?

My thought is that even if it is supported, the performance may not be better than bdwgc, because Go's GC itself is designed to run concurrently with user code.

from nottinygc.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.