r/javascript • • Aug 11 '15

Netflix.com Adopts Universal JavaScript, Drops Java From Rendering Pipeline

http://www.infoq.com/news/2015/08/netflix-universal-javascript
482 Upvotes

115 comments sorted by

View all comments

127

u/[deleted] Aug 11 '15

Does this mean Netflix is now 100% scripted content? I'll show myself the door

21

u/keystorm Aug 11 '15

Nah, it's just getting shorter runtimes.

3

u/hahaNodeJS Aug 12 '15

For at least this set of benchmarks, JavaScript is, on average, 2X slower than Java. JavaScript is 5X slower for 75% of tests. So, while I appreciate your humor, the opposite is generally true.

3

u/dayjobtitus Aug 12 '15

But he didn't specify benchmarks and while taking into account the entire picture it could be slower, the javascript side of things (the side most impacting arguably outside of the stream itself) would perform better and seamless if done right.

1

u/[deleted] Aug 12 '15

While your post isn't a popular one, I agree with you. Java's asynchronous capabilities just don't hold up to JavaScript's.

1

u/I-Code-Things Aug 12 '15

Sounds like they moved a lot of logic to the client side freeing up a lot of server resources.

Also that benchmark is very vague. It says javascript is slower at binary trees. What about them? Constructing them, traversing them? Doing binary searches? Maybe it has something to do with Javascript not having trees and you have to make your own pseudo tree.

Also it doesn't include java vs node server performance. Java has a lot of overhead for making simple requests.

I'm not saying Javascript is a good language for the server by any means. I just think your link is biased and you could find a benchmark that makes javascript look 2x or 5x faster than Java if you wanted.

1

u/igouy Aug 12 '15

Also that benchmark is very vague.

One-click to the source code of each program.

your link is biased

In what way is it biased?

1

u/I-Code-Things Aug 13 '15

In what way is it biased?

Every test includes print statements and setup code which are calculated in the total run time. Not necessarily a big performance hit but in benchmarks that type of stuff should not exist.

Some of the benchmarks use code that was proven in other tests to perform poorly in JS and good in Java. (binary operations, shifts, etc).

Even in JS itself, there are ways to write your code to be much more performant. Scanning through a couple tests showed areas where the JS could be improved significantly.

It's comparing heavyish algorithms where the topic being discussed is using the two languages as serverside languages. Tests related to handling requests under different loads would be more relevant.

Not saying that JS is a fast language at all. Without strict types and having a dynamic compiler, it isn't going to be fast. I'm just saying that showing one person's benchmarks isn't going to convince me that Java is a better server language than Node. Similarly Go often performs much better in benchmarks than Node. However, under normal server conditions (simple rest calls, etc.) their performance is about equal.

1

u/igouy Aug 13 '15 edited Aug 13 '15

Firstly: the claims you make don't seem to be examples of bias in the benchmarks game. otoh when you write - "showing one person's benchmarks isn't going to convince me" - that would be plausible as an example of bias :-)

Secondly:

poorly in JS and good in Java. (binary operations, shifts, etc)

Which tasks, do you say, specify that those operations must be used?

where the JS could be improved significantly

Here's how to contribute your significantly improved JS programs. (Please test that they are significantly improved for the workloads shown, and please diff output against the expected output file.)