4 ms·
CPU intensive workload. Geofence lookups require CPU-intensive point-in-polygon algorithms. While Node.js works great for our other services that are I/O intens
by bufo 11y ago
CPU intensive workload. Geofence lookups require CPU-intensive point-in-polygon algorithms. While Node.js works great for our other services that are I/O intensive, it’s not optimal in this use case due to Node’s interpreted and dynamic-typed nature.
That's misleading, math in V8 can be VERY fast (aside from the current absence of vectorization). See the benchmarks here: http://julialang.org http://julialang.org
- TillE 11y agoCan be. Based on those particular benchmarks, LuaJIT is even better than V8, and I've frequently run into situations where doing math in C++ is 5-10x faster than in LuaJIT. I suspect the lack of an integer primitive is a big deal in both Lua and JavaScript.
- pcwalton 11y ago> I suspect the lack of an integer primitive is a big deal in both Lua and JavaScript. Not as much as you'd think. All JavaScript JITs speculate that numbers that have been observed to be integers remain integers and compiles them to use integer operations. As long as your code is hot enough to enter the optimizing JIT, the overhead is solely in whatever overflow checks couldn't be optimized out.
- chrisseaton 11y agoRight - just because you don't see integer primitives when you're programming doesn't mean they aren't there.
- poorman 11y agoIt doesn't matter how fast the math is, if it's blocking the event thread, response times are going to be slower across the board.
- cdelsolar 11y agoExactly, I keep seeing people missing the point here. The author should have done a better job of emphasizing the non blocking concurrency of Go.
- imaginenore 11y agoEven V8 javascript implementation is actually quite slow. And it's hard to parallelize. http://benchmarksgame.alioth.debian.org/u64q/performance.php?test=binarytrees http://benchmarksgame.alioth.debian.org/u64q/performance.php... http://benchmarksgame.alioth.debian.org/u64q/performance.php?test=knucleotide http://benchmarksgame.alioth.debian.org/u64q/performance.php...