Wish I could respond to his blog entry, but he doesn't have any
commenting enabled.
> --
> 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, send email to nod...@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+un...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
>
Seriously, who here *hasn't* heard that you shouldn't do cpu-intensive
operations in JavaScript? That's not even an area where node "needs
improvement", or some such. Seriously, who calculates the fibonacci
sequence in a web server, or does so using the naive recursive
formulation? It'd completely contrived and idiotic.
Ted Dziuba presents easily-digestible rants for people who want a
reason to not learn about new things. He's the tech equivalent of
Rush Limbaugh. He's a childish amateur troll.
I'm happy that we won't have his antics on this list, since he's not
going to be using node.
As
mentioned above, I don't think node is here to solve *every*
conceivable problem. It does things a certain way, and I like it.
Unfortunately, the truth is that exactly that same program in rails in an 12 cores machine would serve fibonaccis 12x times faster than node.js
Node has issues with cpu bound tasks, still awaiting a solution... and that, @izs, face it, is *not* bs
--
Jorge.
Here's a knowledgeable person saying reasonable things about Node and
Rails and PHP:
http://www.mikealrogers.com/posts/a-new-direction-for-web-applications-.html
Ted Dziuba is just lazy. With just a bit more effort, he could have
maybe come up with something really exciting to criticize. He's a
disgrace to the venerable art of trolling. The only upsetting thing
about this article is that people pay so much attention to such a wart
of a person.
Many many people have one of those traits, but lack the other.
Until then... give him the attention he deserves... and that would
be... about 18 less emails than its already been given ;)
-Karl Tiedt
If he is, he would surely know node is not used for calculating
fibonacci numbers.
--
- Pavan Kumar Sunkara
Joshs-MacBook-Pro:~ josh$ time curl http://localhost:1337/
165580141
real 0m3.942s
user 0m0.004s
sys 0m0.004s
Joshs-MacBook-Pro:~ josh$ time curl http://localhost:8888/fibserver.php
Number is: 165580141
real 1m22.709s
user 0m0.004s
sys 0m0.005s
The PHP code is an exact port of his JS code, available at https://gist.github.com/1258315
Anyone want to write a Rails implementation?
Regards,
–Josh
____________________________________
Joshua Kehn | @joshkehn
http://joshuakehn.com
Anyone want to write a Rails implementation?
Regards,
–Josh
We should give publicity to joshua's blog post.
For someone who's only worked professionally for a few years (according to linkedin) it seems a bit early to be yelling "Get off my lawn" like that, but there you have it. :-)
- ask
--
Ask Bjørn Hansen, http://askask.com/
Have you *really* made the test for ruby ? I tried with PHP, python and scala, and node was actually the fastest (I mean, really, like 8 seconds versus 2 minutes). I wasn't even expecting that, but I must thank Ted for this: I would have never made such a test without his motivation, and now I can really tell Node is damn fast, thanks v8, and thanks Ted.
On 02/10/2011, at 23:42, Tauren Mills wrote:
> I'd like to hear the reactions of other node developers to this article:
> http://teddziuba.com/2011/10/node-js-is-cancer.html
>
> Wish I could respond to his blog entry, but he doesn't have any
> commenting enabled.
Unfortunately, the truth is that exactly that same program in rails in an 12 cores machine would serve fibonaccis 12x times faster than node.js
Node has issues with cpu bound tasks, still awaiting a solution... and that, @izs, face it, is *not* bs
--
Jorge.
>> On Oct 2, 2011, at 14:42, Tauren Mills wrote:
>
> For someone who's only worked professionally for a few years (according to linkedin) it seems a bit early to be yelling "Get off my lawn" like that, but there you have it. :-)
> --
> Ask Bjørn Hansen, http://askask.com/
Bjørn, I'm assuming your comment is a misplaced response to Isaac in
the 'metaprogramming' thread, where he says "Maybe this is the part
where I shake my cane at the ruby kids on my
lawn". I have far more than a "few professional years" behind me, but
I have yet to start yelling "get off my lawn". At least give me
another decade... ;)
Tauren
Hi Tauren,
>> For someone who's only worked professionally for a few years (according to linkedin) it seems a bit early to be yelling "Get off my lawn" like that, but there you have it. :-)
>
> Bjørn,
It's Ask, really. :-) See http://askask.com/
> I'm assuming your comment is a misplaced response to Isaac in
> the 'metaprogramming' thread,
I'm really sorry. My comment was, I thought obviously, directed at Ted's "article" -- not at you or Isaac! I wouldn't have replied publicly further in this thread, but I just wanted to make that clear.
> where he says "Maybe this is the part where I shake my cane at the ruby kids on my
> lawn". I have far more than a "few professional years" behind me, but
> I have yet to start yelling "get off my lawn". At least give me
> another decade... ;)
We're probably all there now and then without realizing it. ;-)
- ask
Seriously, who here *hasn't* heard that you shouldn't do cpu-intensive
operations in JavaScript?
--
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, send email to nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
Chris Sanz
Cofounder & CTO
@csanz
Skype: chrissanz
Have you *really* made the test for ruby ?
I tried with PHP, python and scala, and node was actually the fastest (I mean, really, like 8 seconds versus 2 minutes). I wasn't even expecting that, but I must thank Ted for this: I would have never made such a test without his motivation, and now I can really tell Node is damn fast, thanks v8, and thanks Ted.
> The tone and vocabulary just put me off.
>
> If people don't want to try new things, that's their problem and
> that's fine. But what's the point of insulting those who do and who
> are making things move forwards (even if not always in a straight
> line).
+1
--
Jorge.
All programming languages are cancers. But node is one of the good cancer
> Threads do not scale on cores as people might think they do.
They certainly do on darwin/OSX and in the current generation of intel cpus.
--
Jorge.
> In the rush to defend Node and bash the troll, most overlook the valid
> point that cpu-intensive tasks should be performed asynchronously, and
> child_process.fork() is not a complete solution.
Exactly. +1
--
Jorge.
You know what artists say: People will find many flaws in good art, but
bad art has only one flaw -- itself. Nobody is dismissing Node as a
whole as bad. Not even the original article claims that. You can find
small flaws here and there on any platform, and those get fixed, and new
flaws surface. That's how things are.
--
Branko Vukelic
bra...@brankovukelic.com
bra...@herdhound.com
IDEA MACHINE
www.brankovukelic.com
Lead Developer
Herd Hound (tm) - Travel that doesn't bite
www.herdhound.com
Love coffee? You might love Loveffee, too.
loveffee.appspot.com
I'd like to hear the reactions of other node developers to this article:
http://teddziuba.com/2011/10/node-js-is-cancer.html
Wish I could respond to his blog entry, but he doesn't have any
commenting enabled.
Fair. To be more precise:
You should not do CPU-intensive operations in the main JavaScript
thread if it is also responsible for handling requests in a
low-latency manner.
Obvious is not the same as optimal. It's usually the other way around.
--
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, send email to nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
We need to make it more obvious to people that Node is not limited to
accepting connections on a single thread. That would avoid confusing
inexperienced programmers. Over the next couple months Ben Noordhuis
and I will be working on integrating some of the basic features found
in modules like Cluster into Node core. The ultimate goal is that the
hello world example on the webpage will run across multiple processes
with a simple command line flag.
Forget forever complaining douches, that would be great for node to provide such a solution in core. Go go go :)
--
Big +1 to that
Try this simple Fibonacci algo in Java and "Node":
function fibonacci(n) {
var a = 0, b = 1;
for (var i = 0; i < n; i++) {
a += b;
b = a - b;
}
return a;
}
Test it from fibonacci(1) to fibonacci(50). What do you think about
Java
performance now? Every language has pitfalls but this particular case
is
not a Node one..
---
Diogo R.
On Mon, 3 Oct 2011 14:35:20 -0400, Joshua Kehn wrote:
> Caching the resulting numbers is another obvious optimization.
>
> Of course this all centers around the idea that serving Fibonacci
> numbers is a real problem someone is trying to solve. Which it's not,
> just an example of blocking a process by spinning the CPU. A dumb
> example.
>
> Regards,
>
> –Josh
> ____________________________________
> Joshua Kehn | @joshkehn
> http://joshuakehn.com [18]
>
> On Oct 3, 2011, at 2:32 PM, Charlie McConnell wrote:
>
>> We're all skipping a step here.
>>
>> If this were actually a real-world problem, we would have stopped
>> and said to ourselves something like this:
>>
>> THE FIBONACCI SEQUENCE IS STATIC. IT WILL NEVER, EVER CHANGE.
>>
>> Furthermore, JavaScript's internal issues with integer precision
>> mean that whichever Fibonacci number comes last before the 52-bit
>> mark is the highest one you'll ever need to know. This is in the low
>> eighties somewhere. Spend three tenths of a second computing it on
>> start, every request just grabs the relevant array element after.
>>
>> Nobody should ever be re-computing a static sequence of numbers in a
>> busy process, in any environment. It's a waste of time and CPU.
>>
>> 2011/10/3 Branko Vukelić
>>
>>> On 2011-10-03 13:58 -0400, Joshua Kehn wrote:
>>> > A non-recursive function would be the obvious choice if this
>>> was a real
>>> > problem.
>>>
>>> Obvious is not the same as optimal. It's usually the other way
>>> around.
>>>
>>> --
>>> Branko Vukelic
>>> bra...@brankovukelic.com [1]
>>> bra...@herdhound.com [2]
>>>
>>> IDEA MACHINE
>>> www.brankovukelic.com [3]
>>>
>>> Lead Developer
>>> Herd Hound (tm) - Travel that doesn't bite
>>> www.herdhound.com [4]
>>>
>>> Love coffee? You might love Loveffee, too.
>>> loveffee.appspot.com [5]
>>>
>>> --
>>> Job Board: http://jobs.nodejs.org/ [6]
>>> Posting guidelines:
>>>
>> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
>>> [7]
>>> You received this message because you are subscribed to the
>>> Google
>>> Groups "nodejs" group.
>>> To post to this group, send email to nod...@googlegroups.com [8]
>>> To unsubscribe from this group, send email to
>>> nodejs+un...@googlegroups.com [9]
>>> For more options, visit this group at
>>> http://groups.google.com/group/nodejs?hl=en?hl=en [10]
>>
>> --
>> Charlie McConnell
>> Support Engineer
>> Nodejitsu, Inc.
>> avia...@nodejitsu.com [12]
>>
>> --
>> Job Board: http://jobs.nodejs.org/ [13]
>> Posting guidelines:
>> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
>> [14]
>> You received this message because you are subscribed to the Google
>> Groups "nodejs" group.
>> To post to this group, send email to nod...@googlegroups.com [15]
>> To unsubscribe from this group, send email to
>> nodejs+un...@googlegroups.com [16]
>> For more options, visit this group at
>> http://groups.google.com/group/nodejs?hl=en?hl=en [17]
>
> --
> Job Board: http://jobs.nodejs.org/ [19]
> Posting guidelines:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> [20]
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to nod...@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+un...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en [21]
>
>
> Links:
> ------
> [1] mailto:bra...@brankovukelic.com
> [2] mailto:bra...@herdhound.com
> [3] http://www.brankovukelic.com/
> [4] http://www.herdhound.com/
> [5] http://loveffee.appspot.com/
> [6] http://jobs.nodejs.org/
> [7]
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> [8] mailto:nod...@googlegroups.com
> [9] mailto:nodejs%2Bunsu...@googlegroups.com
> [10] http://groups.google.com/group/nodejs?hl=en?hl=en
> [11] mailto:bra...@brankovukelic.com
> [12] mailto:avia...@nodejitsu.com
> [13] http://jobs.nodejs.org/
> [14]
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> [15] mailto:nod...@googlegroups.com
> [16] mailto:nodejs+un...@googlegroups.com
> [17] http://groups.google.com/group/nodejs?hl=en?hl=en
> [18] http://joshuakehn.com
> [19] http://jobs.nodejs.org/
> [20]
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> [21] http://groups.google.com/group/nodejs?hl=en?hl=en
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
It will be a supervisor process with worker processes. Ideally it will
be transparent:
node -n 5 hello-world.js
hello-world.js:
require('http').Server(function(req, res) {
res.writeHead(200);
res.end("hello world\n");
}).listen(8000);
time node Fibonacci.js 500
1: 1
...
...
498: 5.325493296145951e+103
499: 8.616829160023857e+103
500: 1.3942322456169808e+104
real 0m0.083s
user 0m0.060s
sys 0m0.010s
---
Diogo R.
>> -Josh
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en [10]
--
Charlie McConnell
Support Engineer
Nodejitsu, Inc.
avia...@nodejitsu.com [12]
--
Job Board: http://jobs.nodejs.org/ [13]
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
[14]
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com [15]
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en [17]
--
Job Board: http://jobs.nodejs.org/ [19]
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
[20]
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en [21]
Links:
------
[1] mailto:branko@brankovukelic.com
[9] mailto:nodejs%2Bunsubscribe@googlegroups.com
[10] http://groups.google.com/group/nodejs?hl=en?hl=en
[11] mailto:branko@brankovukelic.com
[12] mailto:avia...@nodejitsu.com
[13] http://jobs.nodejs.org/
[14] https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
[15] mailto:nod...@googlegroups.com
[16] mailto:nodejs+unsubscribe@googlegroups.com
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, send email to nod...@googlegroups.com
To unsubscribe from this group, send email to
The obvious Fibonacci implementation would never be recursive. If anyone
thinks otherwise, you should dedicate yourself to fishing and forget about
programming. This is stupid and Ted is a troll.
I understand what you mean, I know the weakness. Every language has
them.
But what's the point of talking about that using an algo that blows in
almost all languages? Java is no different.
Java has threads. What does it have to do with the blog post about
Fibonacci?
Only a troll would use threads on this example.
If someone wants to point out a language as being better for a specific
task,
be my guest, I might agree. But this post.. it's just stupid.
---
Diogo R.
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, send email to nod...@googlegroups.com
To unsubscribe from this group, send email to
We will also have a low-level API for managing the workers of course
but not as you imagine it. The 99% use-case is symmetric load
balancing. People will still complain about not being able to preempt
work being done for single connections but this is not easily
addressed with Node - nor is it that important - cooperative
multitasking is perfectly valid within a single process.
You should note that the slowness in Python (probably ruby too) comes
from recursiveness. A non-recursive function can get similar (or
better) performance.
This argument is starting to look like:
A: Hey I shot myself in the foot with your gun and it hurts like hell.
B: Yeah, well, the manual says you're not supposed to point it at...
A: I don't care what the manual says, I want a gun that I can shoot my
foot with without the blood and pain and all that crap!
B: Yeah, but you see, we don't sell guns like tha...
A: Fuck you man! You suck!
B: (shoots A in the head) See kido? This is how you use THIS gun.
--
Branko Vukelic
bra...@brankovukelic.com
bra...@herdhound.com
IDEA MACHINE
www.brankovukelic.com
Lead Developer
Herd Hound (tm) - Travel that doesn't bite
www.herdhound.com
Love coffee? You might love Loveffee, too.
loveffee.appspot.com
The API I'd love to have to run cpu-bound tasks (a task = a javascript function + a javascript data object) in the background:
execInBackground(fibonacci, 50, cb);
function cb (err, result) { /* called when done */ }
Is simply identical to that of node's background IO tasks.
--
Jorge.
var x = 100
function foo () { x = 10000 }
evalInBackground(foo, cb)
while (x === 100) {
console.log("ok")
}
throw new Error("SPOOKY!!")
Let's please not ruin node with parallel access to javascript objects.
> --
> 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, send email to nod...@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+un...@googlegroups.com
If you do this with a v8 isolate, it could be made safe. *However*,
afaik the last time this was investigated, the cost of creating a new
context was much too high to do on each request. In fact, that's the
bulk of creating a new node process.
http://code.google.com/chrome/extensions/background_pages.html
This allows you to have an isolate process running some code and
there's a socket.io kinda of connect/notify/read/write interface
from/to the parent process.
K.
---
http://blitz.io
@pcapr