[nodejs] Object as hash with 7 million entries slows V8

2012-05-11 Thread Joran Greef
I have posted this in v8-users but perhaps someone else here will also be familiar with this: I am using V8 as part of Node and have written a Javascript implementation of Bitcask, using a Javascript object as a hash to keep file offsets in memory. This object has 7 million entries and I'm not

Re: [nodejs] Object as hash with 7 million entries slows V8

2012-05-11 Thread Jérémy Lal
Isn't that gc doing its work ? As a workaround, you can turn it off and run it manually node --nouse_idle_notification --expose_gc > global.gc(); Regards, Jérémy. On 11/05/2012 09:51, Joran Greef wrote: > I have posted this in v8-users but perhaps someone else here will also be > familiar with

Re: [nodejs] Object as hash with 7 million entries slows V8

2012-05-11 Thread Joran Greef
The thing is the JS is doing nothing, the huge hash is just sitting there. On Friday, May 11, 2012 9:57:47 AM UTC+2, kapouer wrote: > > Isn't that gc doing its work ? > As a workaround, you can turn it off and run it manually > node --nouse_idle_notification --expose_gc > > global.gc(); > > Re

[nodejs] node.js opportunity in Israel

2012-05-11 Thread Dor Kalev
Awesome Railers, Swifto.com is a start-up that loves animals. We have a warm great team and we enjoy technology much! We are looking for a passionate, responsible, smart, has good communication skills and loves animals *Node.js *developer to join us. We are looking for experienced developers but

Re: [nodejs] Object as hash with 7 million entries slows V8

2012-05-11 Thread Jérémy Lal
Idle -> GC -> visiting objects (?) Hence my suggestion : control gc() calls yourself. On 11/05/2012 10:20, Joran Greef wrote: > The thing is the JS is doing nothing, the huge hash is just sitting there. > > On Friday, May 11, 2012 9:57:47 AM UTC+2, kapouer wrote: > > Isn't that gc doing its

Re: [nodejs] Object as hash with 7 million entries slows V8

2012-05-11 Thread Marcel Laverdet
There is an issue in v8 where idle tick GC does not pick up where the old GC left off and leads to lots of time wasted. See v8 issue #1458. This is fixed in bleeding_edge, but hasn't landed in node yet, not even 0.7.x. Try Jeremy's suggestion or you could also try using bleeding_edge v8 on node 0.7

Re: [nodejs] Object as hash with 7 million entries slows V8

2012-05-11 Thread Joran Greef
Jeremy, I was trying to understand why GC was spending time when there should be no work to do. Marcel, I came across your blog post on the subject an hour ago and spotted the v8 issue as well just before your post here. Thanks for your suggestions. On Friday, May 11, 2012 10:57:20 AM UTC+2, M

[nodejs] Re: Will vert.x pose a threat to node.js?

2012-05-11 Thread Tim Fox
On Friday, May 11, 2012 7:59:29 AM UTC+1, alessioalex wrote: > > With a fair benchmark, Node is 50% faster than Vert.x. By fair benchmark I > mean: both using a single core and both caching the file (so both are now > using the same logic). > > https://gist.github.com/2652991 Incorrect. Vert.x

[nodejs] finding out which packages use node-waf?

2012-05-11 Thread Jeroen Janssen
Hi, Is there an (easy) way of finding out which npm packages use node-waf? I would like to find out which node modules that build C/C++ code have not switched to node-gyp yet. I was hoping it could be derived from the package.json, but so far that doesn't seem to be the case (i.e. some modules ca

[nodejs] [ANN] \nooline – Content Management Made Easy Peasy

2012-05-11 Thread Skyler Brungardt
Announcing \nooline: a Content Management System to make content easy peasy. \nooline is built entirely on node, with an eye for making the experience of managing content (and running a CMS) as simple, easy, and headache-free as possible. Check it out: http://nooline.org On nodejitsu: http://

Re: [nodejs] [ANN] \nooline – Content Management Made Easy Peasy

2012-05-11 Thread Arnout Kazemier
It seems to me that this CMS doesn't really give a fuck about SEO. /me views source and sees no content.. On Friday, May 11, 2012 at 1:03 PM, Skyler Brungardt wrote: > Announcing \nooline: a Content Management System to make content easy peasy. > > \nooline is built entirely on node, with an e

Re: [nodejs] Re: Will vert.x pose a threat to node.js?

2012-05-11 Thread Richard Marr
Definitely agree that its unwise to think in terms of a threat. Node isn't a country that's being invaded. It's a tool that people here find useful. Having more choice in tools is a good thing. Thanks Tim. On 10 May 2012 19:59, Tim Fox wrote: > Here's my take on this: > > I wouldn't think of i

[nodejs] Pass v8 options as part of bash script in Ubuntu

2012-05-11 Thread Joran Greef
I have a bash script which uses Node as the interpreter and I am trying to pass V8 options like this: #!/usr/local/bin/node --nouse_idle_notification --expose_gc --max_old_space_size=32768 console.log('gc exposed: ' + !!global.gc); This works on Mac but not on Ubuntu, the flags don't seem to ha

Re: [nodejs] [ANN] \nooline – Content Management Made Easy Peasy

2012-05-11 Thread Vinayak Mishra
Good attempt, but ignoring current crawler behavior does not look encouraging, more so because most of the crawlers simply ignore javascript. I am in for a templating engine, something that generates static pages for cms like systems. We do already have solutions in other languages, so not real

Re: [nodejs] [ANN] \nooline – Content Management Made Easy Peasy

2012-05-11 Thread Skyler Brungardt
The platform doesn't ignore crawlers - instead, it provides a snapshot of the HTML page using a headless browser (zombie.js). Sometimes we can have cake and eat it too. :-) -Skyler On May 11, 2012, at 8:48 AM, Vinayak Mishra wrote: > Good attempt, but ignoring current crawler behavior do

Re: [nodejs] Re: Will vert.x pose a threat to node.js?

2012-05-11 Thread Ben Noordhuis
On Fri, May 11, 2012 at 12:40 PM, Tim Fox wrote: > On Friday, May 11, 2012 7:59:29 AM UTC+1, alessioalex wrote: >> >> With a fair benchmark, Node is 50% faster than Vert.x. By fair benchmark I >> mean: both using a single core and both caching the file (so both are now >> using the same logic). >>

Re: [nodejs] Object as hash with 7 million entries slows V8

2012-05-11 Thread Tim Caswell
So this will finally get fixed! This exact case was one of the blockers that made me abandon nStore. I was storing offsets in a js object and the GC spun out of control around 1 million entries. (The other blocker was node's fs interface was way too slow to implement a disk-based database, I cloc

Re: [nodejs] finding out which packages use node-waf?

2012-05-11 Thread Matt
Mine (fs-ext) hasn't - I'd welcome patches to convert it over though... On Fri, May 11, 2012 at 6:56 AM, Jeroen Janssen wrote: > Hi, > > Is there an (easy) way of finding out which npm packages use node-waf? > I would like to find out which node modules that build C/C++ code have > not switched t

Re: [nodejs] [ANN] \nooline – Content Management Made Easy Peasy

2012-05-11 Thread Lucas Jans
That's a clever idea. I'd like to see screenshots/demonstration before taking the time to install. On Friday, May 11, 2012 5:53:36 AM UTC-7, Skyler Brungardt wrote: > > The platform doesn't ignore crawlers - instead, it provides a snapshot of > the HTML page using a headless browser (zombie.js)

Re: [nodejs] How to find the node memory leak

2012-05-11 Thread Romain
Use https://github.com/TooTallNate/node-weak and https://github.com/c4milo/**node-webkit-agent . 2012/5/10 Outsider > I think this article is useful. > http://dtrace.org/blogs/bmc/2012/05/05/debugging-node-js-memory-leaks/ > > I didn't use it yet. >

Re: [nodejs] Object as hash with 7 million entries slows V8

2012-05-11 Thread Joran Greef
Ja it was becoming a problem around 3 million entries. Tried multiple smaller hashes, but no help, the GC was still visiting every key in every hash. With nouse_idle_notification, there's no problem, works great now. Tim, I was looking at nStore's file implementation and saw you were serializi

Re: [nodejs] Object as hash with 7 million entries slows V8

2012-05-11 Thread Ben Noordhuis
On Fri, May 11, 2012 at 6:07 PM, Joran Greef wrote: > Ja it was becoming a problem around 3 million entries. > > Tried multiple smaller hashes, but no help, the GC was still visiting every > key in every hash. > > With nouse_idle_notification, there's no problem, works great now. As a general FYI

Re: [nodejs] Object as hash with 7 million entries slows V8

2012-05-11 Thread Tim Caswell
On Fri, May 11, 2012 at 11:07 AM, Joran Greef wrote: > > Tim, I was looking at nStore's file implementation and saw you were > serializing reads. Were you doing this only to use a shared read buffer, or > does this also work with the disk better? I was thinking allowing multiple > concurrent read

Re: [nodejs] Re: Will vert.x pose a threat to node.js?

2012-05-11 Thread Stewart Mckinney
1) Pretty tight. The abstraction layer between v8 and node isn't thick enough or generalized enough, from what I can tell. To be fair, writing an abstraction layer between multiple JS engines is very difficult (I am doing such now for a different project, non-web related). JSC and v8, for instance,

Re: [nodejs] Re: Will vert.x pose a threat to node.js?

2012-05-11 Thread Tim Caswell
On Fri, May 11, 2012 at 11:23 AM, Stewart Mckinney wrote: > 1) Pretty tight. The abstraction layer between v8 and node isn't thick > enough or generalized enough, from what I can tell. To be fair, writing an > abstraction layer between multiple JS engines is very difficult (I am doing > such now f

Re: [nodejs] Will vert.x pose a threat to node.js?

2012-05-11 Thread Ralphtheninja (Magnus Skog)
This could very well explain the factor of 5 between the green and purple bar in: http://vertxproject.files.wordpress.com/2012/05/chart_1.png Den torsdagen den 10:e maj 2012 kl. 17:06:05 UTC+2 skrev koichik: > > Hi, > > Node (libeio) has only 4 [1] background threads (per process) > for file I

[nodejs] Testing global objects on the client

2012-05-11 Thread Evgeny Bogdanov
Hi I test client-side code with node and have some troubles with browser global objects and functions (when do mocking) Here is the code. - lib var run = require('lib').init() module.exports = { 'test global objects': function () { var jQueryMock = {} run(jQueryMock) } } - t

Re: [nodejs] [ANN] \nooline – Content Management Made Easy Peasy

2012-05-11 Thread Vinayak Mishra
Hi Lucas, Maybe I jumped to a conclusion too soon, my bad. When I do npm install I'm getting this error: fatal: Not a git repository: /Users/Mathias/Projects/punycode.js/.git/modules/vendor/qunit Am I missing something here? Also, I get We couldn't find that resource on our server. when I

[nodejs] ANN: Node driver 1.0.1 release (recommended upgrade)

2012-05-11 Thread christkv
1.0.1 - Passing back getLastError object as 3rd parameter on findAndModify command. - Fixed a bunch of performance regressions in objectId and cursor. - Fixed issue #600 allowing for single document delete to be passed in remove command. -- Job Board: http://jobs.nodejs.org/ Post

Re: [nodejs] finding out which packages use node-waf?

2012-05-11 Thread Nathan Rajlich
Here's the list of packages with "preinstall", "install", or "postinstall" scripts: http://registry.npmjs.org/-/scripts?scripts=install,preinstall,postinstall. Now, that doesn't necessarily mean the module is using node-waf, but in reality there's very little use case for using these script phases

Re: [nodejs] ANN: Node driver 1.0.1 release (recommended upgrade)

2012-05-11 Thread Mark Hahn
What module is this? On Fri, May 11, 2012 at 11:37 AM, christkv wrote: > 1.0.1 > > - Passing back getLastError object as 3rd parameter on findAndModify > command. > - Fixed a bunch of performance regressions in objectId and cursor. > - Fixed issue #600 allowing for single docume

Re: [nodejs] ANN: Node driver 1.0.1 release (recommended upgrade)

2012-05-11 Thread Arnout Kazemier
node-mongodb-native aka mongodb On Friday, May 11, 2012 at 9:03 PM, Mark Hahn wrote: > What module is this? > > On Fri, May 11, 2012 at 11:37 AM, christkv (mailto:chris...@gmail.com)> wrote: > > 1.0.1 > > > > - Passing back getLastError object as 3rd parameter on findAndModify

[nodejs] Re: [ANN] Another library to develop desktop apps with HTML5/CSS/JS

2012-05-11 Thread futjikato
Looks highly interesting. I´ll keep an eye on that project :-) Am Freitag, 27. April 2012 22:23:46 UTC+2 schrieb Morteza Milani: > > Forgot repo address:D > > https://github.com/milani/appjs > -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailin

[nodejs] Calculation bug

2012-05-11 Thread Yogesh Agrawal
Hi, I am performing a simple calculation in node.js, but receiving strange result. 0.2 + 0.1 should be equal to 0.3 but in nodejs it's 0.30004 I tried same calculation on browser also http://jsbin.com/amizah/edit#javascript,html same results. It's a bug or some floating point pre

Re: [nodejs] Calculation bug

2012-05-11 Thread Martin Wawrusch
There is a great paper about this out there, but you can get the gist here: http://floating-point-gui.de/ On Fri, May 11, 2012 at 10:41 AM, Yogesh Agrawal wrote: > Hi, > > I am performing a simple calculation in node.js, but receiving strange > result. > > 0.2 + 0.1 should be equal to 0.3 > > bu

Re: [nodejs] Object as hash with 7 million entries slows V8

2012-05-11 Thread Jorge
On May 11, 2012, at 6:17 PM, Tim Caswell wrote: > > > I was doing that to prevent the fs threads from locking too much. Initially > I was doing everything concurrent and spent all my time in mutex locks. I'm > no expert in threads and filesystem interaction. I'm sure it could have been > d

Re: [nodejs] Calculation bug

2012-05-11 Thread C. Mundi
Google for...what every computer scientist should know about floating point arithmetic ... By Goldberg On May 11, 2012 1:00 PM, "Yogesh Agrawal" wrote: > Hi, > > I am performing a simple calculation in node.js, but receiving strange > result. > > 0.2 + 0.1 should be equal to 0.3 > > but in nodejs

Re: [nodejs] Calculation bug

2012-05-11 Thread Mark Hahn
> Any workaround to get correct answer. num.toFixed(10) -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group,

[nodejs] [OT] MeetUp Emprendedores Informáticos

2012-05-11 Thread Leonardo Otero
Para los que se consideren emprendedores los invitamos a formar parte del grupo de meetup Emprendedores Informáticos. http://meetup.com/Emprendedores-informaticos. Saludos. -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Gu

Re: [nodejs] [ANN] \nooline – Content Management Made Easy Peasy

2012-05-11 Thread Skyler Brungardt
Vinayak, Not sure about that's causing that git error – I just performed npm install in a fresh directory with no problems. As for the "We couldn't find that resource on our server" error, it's an alpha, so some assembly is still required. :-) It's likely that you need to add a symlink to th

Re: [nodejs] [ANN] \nooline – Content Management Made Easy Peasy

2012-05-11 Thread Rohit Rao
Nice cms! Sent from my iPhone On May 11, 2012, at 5:12 PM, Skyler Brungardt wrote: > Vinayak, > > Not sure about that's causing that git error – I just performed npm install > in a fresh directory with no problems. > > As for the "We couldn't find that resource on our server" error, it's an

[nodejs] Re: finding out which packages use node-waf?

2012-05-11 Thread Jeroen Janssen
On May 11, 8:48 pm, Nathan Rajlich wrote: > Here's the list of packages with "preinstall", "install", or "postinstall" > scripts:http://registry.npmjs.org/-/scripts?scripts=install,preinstall,postin Thanks for the query! I noticed though that there are atleast 2 entries stating node-gyp usag

Re: [nodejs] Re: finding out which packages use node-waf?

2012-05-11 Thread Nathan Rajlich
Hhhmmm, it's possible that npm injected "install" scripts at one point. Isaac? On Fri, May 11, 2012 at 2:16 PM, Jeroen Janssen wrote: > On May 11, 8:48 pm, Nathan Rajlich wrote: > > Here's the list of packages with "preinstall", "install", or > "postinstall" > > scripts: > http://registry.npmjs.

[nodejs] Reusing connections on http client requests

2012-05-11 Thread Marco Monteiro
Hi. I'm doing hundreds of requests per second to a CouchDB server from 8 node processes, all on the same server, and I'm eventually running out of tcp ports. Node's documentation leads me to believe that I shouldn't need to do anything using http.request to get keep-alive requests, as the defa

[nodejs] node's http.get request fails when receiving text containing a backslash and quote -> \"

2012-05-11 Thread erf
node's http.get request fails when receiving text containing a backslash and quote -> \" i noticed when my server crashed while trying to parse some json from a webservice not sure if im supposed to report this anywhere else or how this works. please advice. -- Job Board: http://jobs.nodejs.or

Re: [nodejs] Calculation bug

2012-05-11 Thread Matthew Hazlett
Its not fixing the problem just hiding it. function add(a, b) { return (a + b).toPrecision(10); } answer = add(0.1, 0.2); // 0.30 On 5/11/2012 1:41 PM, Yogesh Agrawal wrote: Hi, I am performing a simple calculation in node.js, but receiving strange result. 0.2 + 0.1 should be equ

Re: [nodejs] Calculation bug

2012-05-11 Thread Mark Hahn
It is not a problem. That is the correct value for the floating point number. What application do you have that requires that much precision? Were you aware that there is no representation for 0.1 in a finite-precision binary number? The only way to store 0.1 exactly is with fractions or binary

[nodejs] Node HTTP request fails, Wget ok

2012-05-11 Thread Alex Netkachov
Hello, I'm trying to use HTTP module for communicating with chromedriver. Not a quite common use case, of course... Surprisingly, even when the all the parts are reliable, they do not work together. Here are the steps to reproduce: 1. Download chromedriver test and unpack it http://code.g

[nodejs] Re: Node HTTP request fails, Wget ok

2012-05-11 Thread mscdex
On May 11, 8:45 pm, Alex Netkachov wrote: >                 'Content-length' : data.length, Just out of curiousity, instead of `data.length` here, try `Buffer.byteLength(data)` and see how that goes. -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/

[nodejs] Re: node's http.get request fails when receiving text containing a backslash and quote -> \"

2012-05-11 Thread mscdex
On May 11, 7:04 pm, erf wrote: > node's http.get request fails when receiving text containing a > backslash and quote -> \" do you have code somewhere that reproduces this? -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidel

[nodejs] Re: Node HTTP request fails, Wget ok

2012-05-11 Thread Alex Netkachov
On Saturday, May 12, 2012 4:11:30 AM UTC+3, mscdex wrote: > > On May 11, 8:45 pm, Alex Netkachov wrote: > > 'Content-length' : data.length, > > Just out of curiousity, instead of `data.length` here, try > `Buffer.byteLength(data)` and see how that goes. The same. I've created

[nodejs] hamljs issues with node 0.6.17

2012-05-11 Thread kowsik
npm version is 1.1.21. Did an 'npm install hamljs' and require('hamljs') gives me this: Error: Cannot find module 'hamljs' at Function._resolveFilename (module.js:332:11) at Function._load (module.js:279:25) at Module.require (module.js:354:17) at require (module.js:370:17) at repl:

[nodejs] Re: Pass v8 options as part of bash script in Ubuntu

2012-05-11 Thread niknah
This is because of the way linux handles the #!, it happens in all programs, you can change it to... #!/bin/sh /usr/local/bin/node --nouse_idle_notification --expose_gc --max_old_space_size=32768 Another portability problem is the interpretation o

Re: [nodejs] hamljs issues with node 0.6.17

2012-05-11 Thread Martin Cooper
On Fri, May 11, 2012 at 8:30 PM, kowsik wrote: > npm version is 1.1.21. Did an 'npm install hamljs' and > require('hamljs') gives me this: > > Error: Cannot find module 'hamljs' >   at Function._resolveFilename (module.js:332:11) >   at Function._load (module.js:279:25) >   at Module.require (modu

[nodejs] Re: example code to download podcasts

2012-05-11 Thread P. Douglas Reeder
On Thursday, May 10, 2012 2:47:00 AM UTC-4, John wrote: > > surprisingly I didn't see any nodejs / express code examples for > downloading files (podcasts) - does anyone have links? will the > download codet trigger the "save as" dialog on the client ? thks for any > hel > Your question is

[nodejs] Re: example code to download podcasts

2012-05-11 Thread P. Douglas Reeder
I forgot- the HTML5 download attribute allows you to suggest a non-ASCII filename On Saturday, May 12, 2012 1:15:29 AM UTC-4, P. Douglas Reeder wrote: > > > > On Thursday, May 10, 2012 2:47:00 AM UTC-4, John wrote: >> >> surprisingly I didn't see any nodejs / express code examples for >> downloa

Re: [nodejs] Re: example code to download podcasts

2012-05-11 Thread john.tiger
On 05/11/2012 11:15 PM, P. Douglas Reeder wrote: On Thursday, May 10, 2012 2:47:00 AM UTC-4, John wrote: surprisingly I didn't see any nodejs / express code examples for downloading files (podcasts) - does anyone have links? will the download codet trigger the "save as" dialog on