node.js
Node.js 㨠Rust ã«ãã native code ã®ãã¼ã·ã£ãªã³ã°ææ³ã¯ NEON 㨠node-ffi-napi ã®2種é¡ãç¾æç¹ã§æåã§ãããã¼ã·ã£ãªã³ã°é¨åã®ã³ã¹ãã®ç¹å¾´ã大éæã«æ´ãããéãªãã³ããã¼ãã³ã°ããã¾ããã Note: çè«çã«ã¯ãã1㤠N-API ãç´æ¥ãªã³ã¯ã㦠cdâ¦
ãRustã®cdylibãããã¯ã¨ã³ãã«Electronãããã³ãã¨ã³ãã«ãããããã¸ã§ã¯ãã3ç§ãããã§ãæ軽ä½ããcargo-generateã§ããããã¸ã§ã¯ããã³ãã¬ã¼ããå ¬éãã¾ããã template-rust-backend-with-electron-frontend https://github.com/usagi/template-â¦
ä»åã®ã¡ã¢ã® Node.js ã¯: node -v v13.5.0 ã§ããå ã㯠Node.js åå¿è ããã npm i ffi ãã¦æ»ã«ã¾ãã: npm i ffi ã»ãå¤æ°ã®ã¨ã©ã¼ã観測ããæ»ãã§ãã¾ãã¾ãããâ https://www.npmjs.com/package/ffi ã©ãã©ã使ãããªããªã£ã¦ããã®ã§ä½ã代æ¿ã«ç½®ãâ¦
ä¾ã«ãã£ã¦åçªã«çµæãºããã LH-MAIN /tmp% node benchmark_const.js N = 1000000000 9678 [ms] cost of nothing 9379 [ms] cost of 1000000000-th bind var from var 10854 [ms] cost of 1000000000-th bind var from const 11190 [ms] cost of 100000000â¦