WebAssembly让浏览器可以运行接近原生性能的代码。
编译C++到Wasm
#include <emscripten.h>
extern "C" {
EMSCRIPTEN_KEEPALIVE
int add(int a, int b) { return a + b; }
}
emcc hello.cpp -o hello.js应用场景
游戏、图像处理、音视频编解码等计算密集型任务。
WebAssembly让浏览器可以运行接近原生性能的代码。
#include <emscripten.h>
extern "C" {
EMSCRIPTEN_KEEPALIVE
int add(int a, int b) { return a + b; }
}
emcc hello.cpp -o hello.js游戏、图像处理、音视频编解码等计算密集型任务。
评论 (0)
暂无评论,来发表第一条评论吧!
发表评论