How to use bun in zig


it is my bench on windows with this lib
it only has 1516 request per sec

const uws = @import("zuws");
const App = uws.App;
const Request = uws.Request;
const Response = uws.Response;

fn html_handler(res: *Response, _: *Request) void {
    const html_file = @embedFile("./static/main.html.min");
    res.writeStatus("200 OK");
    res.writeHeader("Content-Type", "text/html; charset=utf-8");
    res.writeHeader("Content-Encoding", "br");
    res.writeHeader("Connection", "close");
    res.end(html_file, true);
}

pub fn main() !void {
    const app: App = try .initSSL(.{
        .key_file_name = "./certs/key.pem",
        .cert_file_name = "./certs/cert.pem",
    });
    defer app.deinit();

    try app.get("/*", html_handler)
        .listen("127.0.0.1", 9000, null);
}

using releasefast mode and is even slower than bun

Maybe you could try to use profiling tools to find out where it spends the most time, maybe you can spot some bottleneck that way.

Why don’t you just use Bun, or even uWebSockets.js?

I like zig and want to write zig code not js