header-img
Info :
728x90

Node.js ๋Œ€์•ˆ์„ ๋…ธ๋ฆฌ๊ณ  ์žˆ๋‹ค๊ณ  ํ•˜๋Š” Bun.

ํ”„๋กœ๋•์…˜ ํ™˜๊ฒฝ์„ ์œ„ํ•œ ๋ฒ„์ „ 1.0์„ ์ถœ์‹œํ–ˆ๋‹ค๊ณ  ํ•˜๋Š”๋ฐ..

์–ผ๋งŒํผ์˜ ์ด์ ์„ ๊ฐ€์ง€๊ณ  ์žˆ๊ณ , ์–ด๋–ค ๋‹จ์ ์„ ์ง€๋‹ˆ๊ณ  ์žˆ๋Š”์ง€ ํŠน์„ฑ์— ๊ด€์‹ฌ์ด ์ƒ๊ฒจ ํฌ์ŠคํŒ… ์‹œ๋„ ํ•ด๋ณธ๋‹ค.

 

javascript Runtime 'Bun1.0'

Bun ์ด๋ž€?

javascript ์™€ typescript ๊ธฐ๋ฐ˜ ํ”„๋กœ์ ํŠธ์—์„œ ์‹คํ–‰, ๊ฐœ๋ฐœ, ํ…Œ์ŠคํŠธ, ๋””๋ฒ„๊น… ๊ณผ์ •์„ ํ•œ ๋ฒˆ์— ์ˆ˜ํ–‰ํ•˜๋Š” ๊ฒƒ์„ ๋ชฉํ‘œ๋กœ ๊ฐœ๋ฐœ๋œ AllinOne ๋Ÿฐํƒ€์ž„ ํˆดํ‚ท.

 

Bun ํŠน์ง•

1. ์ ์ฐจ ๋ณต์žกํ•ด์ง€๋Š” ์‹œ์Šคํ…œ ๊ตฌ์กฐ๋กœ ์ธํ•œ ์†๋„์ €ํ•˜๋ฅผ ๊ฐœ์„ ํ•œ ๊ฒƒ์ด ํŠน์ง•. node.js์— ๋น„ํ•ด ์ตœ๋Œ€ 5๋ฐฐ ๊ฐ€๋Ÿ‰ ๋น ๋ฅด๋‹ค๊ณ  ํ•œ๋‹ค.

1-1. ์ฝ”์–ด ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ ์‚ฌ์šฉ

2. Javascript์˜ ๊ธฐ์กด ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์™€ ํ”„๋ ˆ์ž„์›Œํฌ๋Š” ๊ทธ๋Œ€๋กœ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋‹ค.

3. ์ง€๊ทธ(Zig)๋ผ๋Š” ์ƒˆ๋กœ์šด lowlevel ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์–ธ์–ด๋กœ ๋ฉ”๋ชจ๋ฆฌ๋ฅผ ์ง์ ‘ ๊ด€๋ฆฌํ•˜๋Š” ๋“ฑ ๋ฉ”๋ชจ๋ฆฌ ํšจ์œจ ์ง€ํ–ฅ ํ”„๋กœ๊ทธ๋ž˜๋ฐ์ด ๊ฐ€๋Šฅํ•ด์ง.

4. Node.js Common.js, ESM ํ˜ธํ™˜์„ฑ ์ œ๊ณต

 

์†๋„ ๋น„๊ต๋ถ„

console.log("hi") ์‹œ node.js๋ณด๋‹ค 4.5๋ฐฐ ๋น ๋ฅธ ์†๋„ ๋ณด์—ฌ์ค€๋‹ค.

* ๋ฒˆ์—์„œ ์‚ฌ์šฉํ•˜๋Š” ํŒจํ‚ค์ง€ ๋งค๋‹ˆ์ €๋„ npm๋ณด๋‹ค ๋น ๋ฆ„.

 

- ์ถ”ํ›„ Bun ์‚ฌ์šฉ๋ฒ•์— ๋Œ€ํ•˜์—ฌ ํฌ์ŠคํŒ… ํ•ด๋ณด๋„๋ก ํ•˜๊ฒ ๋‹ค.

์†๋„ ์ธก๋ฉด๋„ ์ข‹์ง€๋งŒ ์•ˆ์ •์„ฑ์ด๋‚˜, ์œ ์ง€๋ณด์ˆ˜ ์ธก๋ฉด์— ๋Œ€ํ•œ ํŠน์ง• ๊ธ€๋„ ์ฐพ์•„๋ณด๊ณ  ์‹ถ์—ˆ์ง€๋งŒ ๋ชป ์ฐพ์Œ. ๊ตฌ์กฐ๋ฅผ ๋œฏ์–ด๋ด์•ผํ•˜๋Š” ๊ฑธ๊นŒ..?

 

https://snyk.io/blog/javascript-runtime-compare-node-deno-bun/

 

Node.js vs. Deno vs. Bun: JavaScript runtime comparison | Snyk

Node.js, Bun, and Deno... oh my! In this post, we compare these three popular JavaScript runtimes so you can determine which is the right one for your project.

snyk.io

์šฐ์„  ์ด๋Ÿฐ ๊ธ€์„ ์ฐพ๊ธฐ๋Š” ํ–ˆ๋‹ค.

 

๋Ÿฐํƒ€์ž„ ๋น„๊ต

  • ์„ฑ๋Šฅ๋ฉด์—์„  Bun์ด ๋ชจ๋‘ ์Šน๋ฆฌ
    • ํ‰๊ท  ์ฟผ๋ฆฌ/์ดˆ: Bun 81.37 > Deno 43.50 > Node 21.29
    • ๋™์‹œ ์ปค๋„ฅ์…˜: Bun 110,000 > Deno 67,000 > Node 60,000
  • ์ง€์› ๋ฐ ์ปค๋ฎค๋‹ˆํ‹ฐ
    • ์Šคํƒ์˜ค๋ฒ„ํ”Œ๋กœ์šฐ ์งˆ๋ฌธ์ˆ˜ : Node 46๋งŒ๊ฐœ > Deno 917๊ฐœ > Bun 52๊ฐœ
    • ์‚ฌ์šฉ์ž์ˆ˜(StateOfJS ์กฐ์‚ฌ๊ฒฐ๊ณผ) : Node 27976 > Deno 3355 > Bun 1263
  • ์•ˆ์ •์„ฑ
    • Node.js ๋Š” ์ „์„ธ๊ณ„ ์›น์‚ฌ์ดํŠธ 2.1%๊ฐ€ ์‚ฌ์šฉ์ค‘
    • Deno ๋Š” 1.0์ด 2020๋…„์— ๋‚˜์™”๊ณ  ์ˆ˜์šฉ์ด ๋Š๋ฆผ
    • Bun ์€ ์•„์ง 0.73์œผ๋กœ ๋ฒ ํƒ€. 9์›”์— 1.0 ์˜ˆ์ •
  • ๋ณด์•ˆ
    • Node.js ์˜ ๋ถ€์กฑํ•œ ๋ณด์•ˆ์„ Deno๊ฐ€ ๊ฐœ์„ ํ–ˆ์ง€๋งŒ, Node๋„ ๊ถŒํ•œ ๋ชจ๋ธ์„ ๋„์ž…ํ•˜๋ฉด์„œ ๋น„์Šทํ•ด์ง
    • Bun ์€ ์•„์ง ๋ณด์•ˆ ๊ด€๋ จ ์ •๋ณด๊ฐ€ ๋งŽ์ด ์—†์Œ
  • ์ถ”๊ฐ€ ๊ธฐ๋Šฅ๋“ค
    • Node.js ๊ฐ€ ์ตœ๊ทผ Deno/Bun ๊ณผ ๋น„์Šทํ•œ ๊ธฐ๋Šฅ์„ ๋งŽ์ด ๋„์ž…์ค‘. Typescript ์ง€์›๋„ ํ™œ๋ฐœํžˆ ๋…ผ์˜ ์ค‘
    • Deno ์—๋Š” Dependency Inspector ์™€ Code Formatter ๋‚ด์žฅ
    • Bun ์€ Transpiler ์™€ Package Manager ๋‚ด์žฅ. ์ด๋ฆ„์—์„œ ๋ณผ์ˆ˜ ์žˆ๋“ฏ์ด ๋ฒˆ๋“ค๋ง ๊ธฐ๋Šฅ๋„ ํฌํ•จ

์–ด๋–ค๊ฒŒ ๋‚˜์—๊ฒŒ ์ ํ•ฉํ• ๊นŒ ?

  • Bun ์ด ํ™•์‹คํžˆ ์†๋„๋ฉด์—์„œ ์šฐ์ˆ˜ํ•จ. ํ•˜์ง€๋งŒ ์ƒˆ๋กœ์šด ๊ฒƒ์ด๋ผ ์œ„ํ—˜์ด ์žˆ์Œ.
  • Node.js ์˜ ์žฅ์ ์€ ์„ฑ์ˆ™๋„์™€ ์ƒํƒœ๊ณ„
  • Deno ๋Š” Node์— ๋น„ํ•ด ๋” ์›ํ™œํ•œ ๊ฐœ๋ฐœ์„ ๊ฐ€๋Šฅํ•˜๊ฒŒ ํ•˜๊ณ , ๋ณต์žกํ•œ ํ”„๋กœ์ ํŠธ๋ฅผ ๊ณ ํ’ˆ์งˆ๋กœ ์‰ฝ๊ฒŒ ๊ตฌ์ถ•ํ•  ์ˆ˜ ์žˆ๊ฒŒ ํ•ด์ฃผ๋Š” ๊ธฐ๋Šฅ๋“ค์„ ํฌํ•จ. ์•ˆ์ „ํ•˜๊ณ  Node ๋ณด๋‹ค ๋น ๋ฅด์ง€๋งŒ Bun์— ๋น„ํ•ด ์•ฝ๊ฐ„ ๋Š๋ฆผ
  • Node๊ฐ€ ์‚ฌ๋ก€๊ฐ€ ๋งŽ์€ ์•ˆ์ „ํ•œ ์˜ต์…˜. Deno๋Š” ์ถ”์ฒœํ•  ๊ธฐ๋Šฅ๋“ค์ด ๋งŽ๊ณ  ์ตœ์‹  ๊ธฐ๋Šฅ๋“ฑ์„ ๋งŽ์ด ํฌํ•จ. Bun ์€ ์†๋„์— ๊ด€์‹ฌ์ด ์žˆ๊ฑฐ๋‚˜ ์ตœ์ฒจ๋‹จ ๊ธฐ์ˆ ์„ ์ด์šฉํ•˜๊ณ  ์‹ถ์€ ๊ฒฝ์šฐ ์„ ํƒ์„ ๊ถŒํ•จ
728x90
๋”๋ณด๊ธฐ
BACKEND