v8

NodeJS recommended max-old-space-size

时光怂恿深爱的人放手 提交于 2019-12-03 02:14:39
问题 I'm having some trouble to understand how NodeJS acts based on the parameter max-old-space-size. In my case for example, I'm running two t2.small aws instances (2GB of RAM). Not sure why but I did set max-old-space-size=4096 (4GB). What does node do in this case? Could this configuration lead to a posible memory allocation failure? How do I determine the correct value of max-old-space-size based on the server resources? PD: My application is constantly growing the memory usage and I'm trying

Pop up blocker API- how to check if user has it enabled

試著忘記壹切 提交于 2019-12-03 01:25:40
I need to know when the user clicks on the button that triggers window.open if there is stable API/way to know beforehand if the user actively has a pop-up blocker? In some cases the user doesn't know/pay attention that they have pop-up blocker (that block the new window). I would like to inform them by some dialog/or something to authorize a new window by clicking on allow. Window.open(...) returns a handle to the new window if it exists. If it doesn't have a handle to the new window, that's a pretty good indication the window was blocked. https://developer.mozilla.org/en-US/docs/Web/API

slow function call in V8 when using the same key for the functions in different objects

自作多情 提交于 2019-12-03 01:19:45
问题 Maybe not because the call is slow, but rather the lookup is; I'm not sure, but here is an example: var foo = {}; foo.fn = function() {}; var bar = {}; bar.fn = function() {}; console.time('t'); for (var i = 0; i < 100000000; i++) { foo.fn(); } console.timeEnd('t'); Tested on win8.1 firefox 35.01: ~240ms chrome 40.0.2214.93 (V8 3.30.33.15): ~760ms msie 11: 34 sec nodejs 0.10.21 (V8 3.14.5.9): ~100ms iojs 1.0.4 (V8 4.1.0.12): ~760ms Now here is the interesting part, if i change bar.fn to bar

What makes this function run much slower?

别来无恙 提交于 2019-12-03 01:09:22
问题 I've been trying to make an experiment to see if the local variables in functions are stored on a stack. So I wrote a little performance test function test(fn, times){ var i = times; var t = Date.now() while(i--){ fn() } return Date.now() - t; } ene function straight(){ var a = 1 var b = 2 var c = 3 var d = 4 var e = 5 a = a * 5 b = Math.pow(b, 10) c = Math.pow(c, 11) d = Math.pow(d, 12) e = Math.pow(e, 25) } function inversed(){ var a = 1 var b = 2 var c = 3 var d = 4 var e = 5 e = Math.pow

Linking To V8 Snapshot

匿名 (未验证) 提交于 2019-12-03 00:59:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to link to a V8 library (v8_base.lib) that I've compiled in Visual Studio 2008 with the /MDd option. When I link to it from another library I get errors like: Error 4 error LNK2001: unresolved external symbol "private: static int const v8::internal::Snapshot::size_" (?size_@Snapshot@internal@v8@@0HB) v8_base.lib myapp How can I resolve these issues? (List of all errors) Error 1 error LNK2019: unresolved external symbol "public: static int __cdecl v8::internal::NativesCollection<0>::GetBuiltinsCount(void)" (?GetBuiltinsCount@?

Error: Cannot find module &#039;core-util-is&#039;

匿名 (未验证) 提交于 2019-12-03 00:22:01
1、错误描述 C:\Users\Administrator>cd cma C:\Users\Administrator\cma>webpack you.js today.js C:\Users\Administrator\node_modules\webpack-cli\bin\webpack.js:449 throw err; ^ Error: Cannot find module 'core-util-is' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:571:15) at Function.Module._load (internal/modules/cjs/loader.js:497:25) at Module.require (internal/modules/cjs/loader.js:626:17) at require (C:\Users\Administrator\node_modules\v8-compile-cache\v8-compile- cache.js:159:20) at Object.<anonymous> (C:\Users\Administrator\node_modules\_readable-stream@ 2.3.6@readable-stream

Access the Abstract Syntax Tree of V8 Engine

自闭症网瘾萝莉.ら 提交于 2019-12-03 00:21:22
Is it possible to access the AST of the v8 engine, for a given JavaScript code? I'm working on a JavaScript Static Analyzer using V8 engine. This is pretty old but maybe the answer helps someone stumbling upon this. The answer is yes, assuming you are willing to modify V8 and compile your own version of it. If so, then in compiler.cc you find a spot where MakeCode is called throughout MakeFunctionInfo which transforms the AST that is stored in the passed in CompilationInfo object into native code. You need to write a class that inherits from AstVisitor then you can inspect the AST by inserting

centos 上安装nodejs v8.0.0

匿名 (未验证) 提交于 2019-12-02 21:59:42
新建目录www 下载nodejs wget https://npm.taobao.org/mirrors/node/v8.0.0/node-v8.0.0-linux-x64.tar.xz 解压 tar -xvf node-v8.0.0-linux-x64.tar.xz 测试是否安装成功 bin ls cd node-v8.0.0-linux-x64/bin && ls 有node npm 测试 ./node -v 安装成功 node npm ln -s /www/node-v8.0.0-linux-x64/bin/node /usr/local/bin/node ln -s /www/node-v8.0.0-linux-x64/bin/npm /usr/local/bin/npm node npm 文章来源: centos 上安装nodejs v8.0.0

Which is faster, Clojure or ClojureScript (and why)?

我是研究僧i 提交于 2019-12-02 21:49:30
If I had to guess, I'm pretty sure the answer is Clojure, but I'm not sure why. Logically (to me) it seems like ClojureScript should be faster: Both are "dynamic", but ClojureScript Compiles to JavaScript, running on V8 V8 engine is arguably the fastest dynamic language engine there is V8 is written in C whereas Clojure: Is also dynamic Runs in JVM, which has no built-in dynamic support, so I'm thinking thus JVM has to do whatever V8 is doing too, to enable dynamic support and Java is slower than C So how could Clojure be faster than ClojureScript? Does "dynamic" mean something different when

V8

与世无争的帅哥 提交于 2019-12-02 21:47:26
Introduction 介绍 Welcome to the developer documentation for V8. V8 is Google's open source, high performance JavaScript engine. It is written in C++ and is used in Google Chrome , Google's open source browser. 欢迎来到 V8 的 开发者文档。 V8 是谷歌开源,高性能的 JS 引擎。它使用 C++ 编写并且被用于 Chrome ,谷歌的开源浏览器。 This documentation is aimed at C++ developers who want to use V8 in their applications, as well as anyone interested in V8's design and performance. This document introduces you to V8, while the remaining documentation shows you how to use V8 in your code and describes some of its design details, as well as providing a