#Is it beneficial for performance to `bun build`?

1 messages · Page 1 of 1 (latest)

worn dock
#

I was questioning if i should be building my small bun script (super small api) first before executing it or is running the .ts file directly. are there any major performance differences?

im not serving any web content or whatever, is just a plain text protocol

maiden saddle
charred nova
#

My 1.2KB script turned into 82 MB executable

#

And performance difference was negligible

maiden saddle
#

because bun includes its own executable inside it

charred nova
#

So it doesn't compile it down to machine code?

#

Like go executable was like 6MB

#

That's a huge difference

opal rain
#

the compile option basically just bundles the script and appends it to the bun executable

charred nova
#

Although I don't mind 82MB i just don't like bun used a lot of memory even when it is running an idle server

opal rain
#

there's usually no reason to do that

#

You can just bundle it normally

charred nova
#

I just run it directly