Re:How We Built Uber’s Highest Query per Second Service Usin...
by hughw on Tuesday March 01, 2016 @05:08PM
(#11206507)
I was surprised that they felt Node's performance was slower for computation, given the effort V8 has put into optimization. Particularly he called out "interpreted" and "dynamic-typed". But V8 compiles and optimizes frequently used functions, and recompiles running functions when it detects that they are being called with the same runtime types repeatedly. This runtime optimization can't be quite as fast overall as Go, but I'd be surprised if well-designed JS couldn't run 60-80% as fast. Maybe that's enough difference for them to make the switch.
[ Parent
| on HN ]
Re:How We Built Uber’s Highest Query per Second Service Usin...
by sloppyfocus on Wednesday March 02, 2016 @02:54AM
(#11208625)
I work at Uber. We've discovered that in terms of average response time, our node services have remarkable performance. For example, some of our fastest node services have 1-5ms p95 response time. When you start diving into the p99 latency, garbage collection pauses can spike response time to tens or hundreds of ms, and eliminating these spikes is incredibly nontrivial.
Re:How We Built Uber’s Highest Query per Second Service Usin...
by nailer on Wednesday March 02, 2016 @03:21AM
(#11208712)
Is it possible to tune the V8 GC in the same way trading environments (or anywhere where RAM is cheaper than latency) do for Java?
Re:How We Built Uber’s Highest Query per Second Service Usin...
by physguy1123 on Wednesday March 02, 2016 @10:21AM
(#11210435)
Usually, financial companies will use one of the commercial realtime jvms - it's not just some tuning. Javascript being singlethreaded would certainly simplify having a pauseless GC but it's still a nontrivial problem and I'm not sure how much that would benefit the browser use case.
Re:How We Built Uber’s Highest Query per Second Service Usin...
by nailer on Wednesday March 02, 2016 @12:38PM
(#11211511)
Understood. Small point: I wasn't discussing browsers (nor was the article).
Re:How We Built Uber’s Highest Query per Second Service Usin...
by cdelsolar on Tuesday March 01, 2016 @11:47PM
(#11208138)
I think the bigger issue here is that Node is blocking while a computationally intensive algorithm is running whereas Go can have multiple goroutines still serving requests while running the algorithm.
Re:How We Built Uber’s Highest Query per Second Service Usin...
by kintamanimatt on Wednesday March 02, 2016 @01:32AM
(#11208431)
You just take the computationally expensive work and run it elsewhere, like a worker pool. This is a standard pattern for this kind of work and what you would do with go too, except the worker pool might just be a number of goroutines.
Re:How We Built Uber’s Highest Query per Second Service Usin...
by hughw on Tuesday March 01, 2016 @09:54PM
(#11207824)
It's chickens*t to down vote my comment, when you could argue a fact, or explain something to me that I don't understand.
My question isn't silly. I just now wrote two short programs, one in Go and one Javascript, to run a vector multiply and add on two length 1000 vectors, a million times. The JS program is faster.
Result (in seconds):
$ node vmadd.js
0.984
$ go run vmadd.go
1.141044662
JS code:
https://gist.github.com/hwinkler/62c9da0d9f2d8c7981b0Go code: https://gist.github.com/hwinkler/d234bb62b2c5fa081a50
Re:How We Built Uber’s Highest Query per Second Service Usin...
by _ph_ on Wednesday March 02, 2016 @02:19AM
(#11208534)
Go run first compiles the code and builds an executable. You are mostly benchmarking for both systems the compilation time. Building an executable in Go takes most of a second. A significant benchmark would check the run times.
Re:How We Built Uber’s Highest Query per Second Service Usin...
by hughw on Thursday March 03, 2016 @12:33PM
(#11218382)
No, if you examine the code, you'll see the timer times only the accumulated execution time for the loop. The code has been compiled. See below to eliminate doubt -- I used go build and got similar numbers.
Re:How We Built Uber’s Highest Query per Second Service Usin...
by artursapek on Wednesday March 02, 2016 @02:04PM
(#11212140)
Exactly. Build it and then benchmark the binary. Nobody uses `go run` in production.
Re:How We Built Uber’s Highest Query per Second Service Usin...
by hughw on Thursday March 03, 2016 @10:55AM
(#11217600)
$ go build vmadd.go
$ ./vmadd
1.106074715
This is a 2013 Core i7 15" MBP
Re:How We Built Uber’s Highest Query per Second Service Usin...
by hughw on Thursday March 03, 2016 @12:34PM
(#11218386)
I'd rather be right, than have karma.