Tag Info

Hot answers tagged

6

Bluebird author here. The accepted answer is wrong. V8 promises implementation is written in JavaScript not C. All JavaScript (including V8's own) is compiled to native code. Additionally user written JavaScript is optimized, if possible (and worth it), before compiled to native code. Promises implementation is something that would not benefit much or at ...


4

Is the cache always rendered useless after a context switch? No, not at all. Context switches are actually a concept of the software that runs on a CPU, not one of the CPU itself. When the software decides to do a context switch, the state of the CPU is saved somewhere convenient, a new or previously-saved state is loaded and execution jumps to the ...


4

Whether there is a performance penalty or not, would depend on whether your Java compiler is capable of in-lining / unrolling trivial lambda expressions like this one. In general, inlining in Java is limited by the presence of the final modifier, or when the compiler can deduce that the final keyword could have been used in the local context without ...


3

That's generally where horizontal scalability (distributed computing/multiple nodes and load balancing) comes into play. Every system is going to have some kind of upper limit on vertical scalability. One critical key to horizontal scalability is state management. You want to design your software so that individual sessions don't require affinity to a ...


2

Ok if nobody else wants to, I'll have a hack at it, assuming avx2 available (untested because avx2 isn't for me). No idea if this is actually faster than just plowing through 8 iterations of bsf on a 64 bit integer register. I have my doubts. Assume src_address holds the most significant bit. src_address + 511 holds the least. bsf finds the least ...


2

In the first case, you'll have to either create a lookup or to loop through the tags to find a specific tag. In the second case, .NET Framework does that for you when processing the XML file. For instance, if you want to find multiple times (and by multiple, I mean a lot) whether a requirement has a specific tag, the second case usage will be ...


1

This question probably doesn't belong to programmers but var request = function() { return new Promise(function(resolve, reject) { ... resolve(data); ... reject(err); } }; Is of course much slower than var request = promisify(function(callback) { ... callback(null, data); ... callback(err); }); However, ...


1

It depends on the contents of the Context structure. If it contains less data than is the size of a pointer on your architecture, then the memory is wasted, because the size of the pointer + payload is more than twice as large as the payload itself. Another problem might be memory access. When you access the data through a pointer, memory has to be read ...


1

I'll discourage the option to use triggers in such case. You might be better off thinking in API terms to your model. As the comments point out, use stored procedures, as they will be easier to debug in case something goes not according to plan, keep in mind that you have a quite complex situation ;-) Some helpful references, wikipedia article about ...


1

This is originally a comment seeking clarifications, but is too long to fit. So I posted each question here, along with my "what-if" answers for each question based on possible responses. Before seeking clarifications, everyone should see that the current implementation has time complexity that is quadratic in the number of waypoints. The notation is ...


1

You have large graph and you made it even larger. Martinc C. Martin advised using lathes only when needed, so i will not go into this. One of things that could help you, is tranform your graph into smaller graphs. First simplification that helped me a lot (I worked with road networks of europian states) was "removing" nodes with digree 1 and 2 recursively. ...



Only top voted, non community-wiki answers of a minimum length are eligible