wasmerio / wasmer-java

☕ WebAssembly runtime for Java
https://medium.com/wasmer/announcing-the-first-java-library-to-run-webassembly-wasmer-jni-89e319d2ac7c
MIT License
593 stars 55 forks source link

Bump wasmer dependencies to 2.0.0 #60

Closed jcaesar closed 2 years ago

jcaesar commented 3 years ago

Since wasmer-runtime doesn't exist anymore in 2.0, I wonder what this should look like.

Or maybe it's time to rewrite wasmer-java to more closely follow the new API introduced with 1.0?

Hywan commented 3 years ago

Hello, Yes we are planning to rewrite the extension to improve its API. But your PR is valid though :-), thnaks!

jcaesar commented 3 years ago

Hm. It's about 30% slower on instantiating modules in a tight loop because the global store is gone. Also, after about 16300 instantiations (suspicious number, I know..) it fails with

Exception in thread "main" java.lang.RuntimeException: Failed to instantiate the module: Insufficient resources: Failed to create memory: Error when allocating memory: System call failed: Cannot allocate memory (os error 12)

but that's the same with 1.0.2.

aristotaloss commented 3 years ago

@jcaesar The number caught my eye: 16300 is the exact number that I read a few minutes ago in this repo: https://github.com/cretz/asmble#caveats (search for 16300). I wonder if it's related somehow? Unsure what the Java wrapper does under the hood but figured I'd toss this here.

jcaesar commented 3 years ago

I think that's coincidence. I never measured the exact number though, it might be 0x4000, e.g.

jcaesar commented 2 years ago

(Cleaning up my open PRs. 3.0 will be out soon, too.)