Open morkai opened 8 years ago
Thank you for checking this out and doing the tests! We will investigate the scenario you described. Indeed we have areas that need more work to improve performance.
I tried your "Simple TCP client-server scripts" on win7 x64 and didn't see the crash. So the crash was in mongoDB test? Please let us know if you found an easier repro.
There wasn't any crash. If a file is passed as the first argument, then it isn't executed. If no file is passed - the REPL is not started.
For example, given file hello.js
:
console.log('Hello World!');
on Win10 machine I get:
C:\Workspace>"C:\Program Files\nodejs (chakracore)\nodevars.bat"
Your environment has been set up for using Node.js 6.0.0-pre1 (x64) and npm.
C:\Workspace>node -v
v6.0.0-pre1
C:\Workspace>node hello.js
Hello World!
C:\Workspace>
on Win7 machine:
C:\Workspace>"C:\Program Files\nodejs (chakracore)\nodevars.bat"
Your environment has been set up for using Node.js and npm.
C:\Workspace>node -v
v6.0.0-pre1
C:\Workspace>node hello.js
C:\Workspace>
What version of Win7 do you have? I'm on Windows 7 Enterprise Service Pack 1 and the hello.js example works.
C:\tmp>ver
Microsoft Windows [Version 6.1.7601]
C:\tmp>"c:\Program Files\nodejs (chakracore)\nodevars.bat"
Your environment has been set up for using Node.js 6.0.0-pre1 (x64) and npm.
C:\tmp>node -v
v6.0.0-pre1
C:\tmp>node hello.js
Hello World!
My Computer Properties shows Windows 7 Enterprise Service Pack 1 64-bit.
ver
shows Microsoft Windows [Version 6.1.7601].
It currently has:
It is a company laptop and has McAfee running (can't disable it).
@morkai , Regading crash on Windows 7, similar issue was recently reported at Microsoft/chakracore#212 and was fixed with Microsoft/chakracore#202. Just to make sure that this is same issue, could you please confirm if your machine has IE11
installed?
No IE11
on the Windows 7 machine - only IE9
.
Thanks for confirming @morkai . The latest release should unblock you from using Node.js with chakracore
on Windows 7 machine.
We are investigating the performance issue you reported and will update you on it.
@morkai , after investigating this for sometime, it seems that the slowness in node+chakracore is happening because of JIT optimization that we don't do for arguments
. See Microsoft/Chakracore#313 for details.
I noticed some other areas in chakrashim that needs tweaking to improve performance.
JsGetOwnPropertyNames
if there were no properties on the template. In my experiment I saw some performance gain by tweaking this.UInt8Array
object is created and the prototype of that object is set immediately after creation. In engine, there is inline caching optimization around object's properties and we invalidate the caches of that object and its prototype chain if we see the prototype of an object has changed (SetPrototype is internally detected as ChangePrototype). For new type that is just created, we should not bother invalidating the inline cache. We spend sometime doing this in the perf test that you shared.JsGetPropertyIdFromName
repeatedly for same property names. We could save calls to engine if we can cache the propertyId to propertyName mapping.On my dev machine, I was seeing approx. 68000 req/sec with node+v8. Before my changes mentioned above, node+chakracore was at 27000 req/sec. After my changes it boosted up to 44000 req/sec. I will continue my investigation in other gaps, but i think this is good starter point to catch up on TCP modules.
@kunalspathak Can we test the delta between node-v8 and node-chakracore?
So I've decided to see how node-chakracore v6.0.0-pre1 will compare to node-v8 v5.4.0 in generating reports in one of my apps (~500k documents fetched from MongoDB). On average node-chakracore took 2x more time to finish than node-v8.
Then I tried to import data from 27 ~8 MB text files. Parsing (CPU only) in ChakraCore was faster than in v8 (chakra=6.8s vs v8=5.6s), but then came time for some I/O (MongoDB) and there v8 won again (chakra=143s vs v8=50s).
Simple TCP client-server scripts show that the
net
module is 2x slower in ChakraCore (92kdata
events per second in v8 - 42k in ChakraCore).node and MongoDB are on the same machine (Windows 10 Home 64-bit). Tried to run it on a different machine (laptop) with Windows 7 Enterprise 64-bit, but node.exe ends immediately without any errors (
node -v
still showsv6.0.0-pre1
).