text:
Multithreading C/C++ GCC/Clang OLTP Client crazy stuff Overload Database Server multiplayer non-blocking Determinism
Infographics: Operation Costs in CPU Clock Cycles
posted September 12, 2016 by "No Bugs" Hare, translated by Sergey Ignatchenko
UPDATED: TLB and CAS/atomics (including different NUMA node) added
NB: scale is logarithmic!
Premature Pessimization Easy on yourself, easy on the code: All other things being equal, notably code complexity and readability, certain efficient design patterns and coding idioms should just flow naturally from your fingertips and are no harder to write than the pessimized alternatives. This is not premature optimization; it is avoiding gratuitous pessimization.— Herb Sutter, Andrei Alexandrescu —Whenever we need to optimise the code, we should profile it, plain and simple. However, sometimes it makes sense just to know ballpark numbers for relative costs of some popular operations, so you won't do grossly inefficient things from the very beginning (and hopefully won't need to profile the program later 🙂 ).
So, here it goes – an infographics which should help to estimate costs of certain operations in CPU clocks cycles – and answer the questions such as "hey, how much L2 read usually costs?". While answers to all these questions are more or less known, I don't know of a single place where all of them are listed and put into perspective. Let's also note that while the listed numbers, strictly speaking, apply only to modern x86/x64 CPUs, similar patterns of relative operation costs are expected to be observed on other modern CPUs with large multi-level caches (such as ARM Cortex A, or SPARC); on the other hand, MCUs (including ARM Cortex M) are different enough so some of the patterns may be different there.
Last but not least, a word of caution: all the estimates here are just indications of the order of magnitude; however, given the scale of differences between different operations, these indications may still be of use (at least to be kept in mind to avoid "premature pessimisation").
On the other hand, I am still sure that such a diagram is useful to avoid saying things "hey, virtual function calls cost nothing" – which may or may not be true depending on how often you call them. Instead, using the infographics above – you'll be able to see that
if you call your virtual function 100K times per second on a 3GHz CPU – it probably won't cost you more than 0.2% of your CPU total; however, if you're calling the same virtual function 10M times per second – it can easily mean that virtualisation eats up double-digit percentages of your CPU core.
Another way of approaching the same question is to say that "hey, I'm calling virtual function once per piece of code which is like 10000 cycles, so virtualisation won't eat more than 1% of the program time" – but you still need some kind of way to see an order of magnitude for the related costs – and the diagram above will still come in handy 🙁 .
Preliminaries aside, let's take a closer look at those items on our infographics above.
ALU/FPU Operations
For our purposes, when speaking about ALU operations, we will consider only register-register ones. If memory is involved, the costs can be VERY different – and will depend on "how bad the cache miss was" for the memory access, as discussed below.
"Simple" Operations
These days (and on modern CPUs), "simple" operations such as ADD/MOV/OR/… can easily have costs of less than 1 CPU cycle. This doesn't mean that the operation will be literally performed in half a cycle. Instead –
while all operations are still performed in a whole number of cycles, some of them can be performed in parallel
In [Agner4] (which BTW is IMO the best reference guide on CPU operation costs), this phenomenon is represented by each operation having two associated numbers – one is latency (which is always a whole number of cycles), and another is throughput. It should be noted, however, that in real-world, when going beyond order of magnitude estimates, exact timing will depend a lot on the nature of your program, and on the order in which the compiler has put seemingly-unrelated instructions; in short – whenever you need something better than an order-of-magnitude guesstimate, you need to profile your specific program, compiled with your specific compiler (and ideally – on a specific target CPU too).
Further discussion of such techniques (known as "out of order execution"), while being Really Interesting, is going to be way too hardware-related (what about "register renaming" which happens under the hood of CPU to reduce dependencies which prevent out-of-order from working efficiently?), and is clearly out of our scope at the moment 🙁 .
Integer Multiplication/Division
"Integer multiplication/division is quite expensive compared to 'simple' operations above.Integer multiplication/division is quite expensive compared to "simple" operations above. [Agner4] gives cost of 32/64-bit multiplication (MUL/IMUL in x86/x64 world) at between 1-7 cycles (in practice, I've observed more narrow range of values, such as 3-6 cycles), and cost of 32/64-bit division (known as DIV/IDIV on x86/64) – at between 12-44 cycles.
Floating-Point Operations
Costs of floating-point operations are taken from [Agner4], and range from 1-3 CPU cycles for addition (FADD/FSUB) and 2-5 cycles for multiplication (FMUL), to 37-39 cycles for division (FDIV).
If using SSE scalar operations (which apparently every compiler and its dog does these days), the numbers will go down to 0.5-5 cycles for multiplication (MULSS/MULSD), and to 1-4o cycles for division (DIVSS/DIVSD); in practice, however, you should expect more like 10-40 cycles for division (1 cycle is "reciprocal throughput", which is rarely achievable in practice).
128-bit Vector Operations
For quite a few years, CPUs are providing "vector" operations (more precisely – Single Instruction Multiple Data a.k.a. SIMD operations); in Intel world they're known as SSE and AVX and in ARM world – as ARM Neon. One funny thing about them is that they operate on "vectors" of data, with data being of the same size (128 bit for SSE2-SSE4, 256 bit for AVX and AVX2, and 512 bits for upcoming AVX-512) – but interpretations of these bits being different. For example, 128-bit SSE2 register can be interpreted as (a) two doubles, (b) four floats, (c) two 64-bit integers, (d) four 32-bit integers, (e) eight 16-bit integers, (f) 16 8-bit integers.
[Agner4] gives the costs of integer addition over 128-bit vector at < 1 cycle if the vector is interpreted as 4×32-bit integers, and at 4 cycles if it is 2×64-bit integers; multiplication (4×32 bits) goes at 1-5 cycles – and last time I checked, there were no integer division vector operations in x86/x64 instruction set. For floating-point operations over 128-bit vectors, the numbers go from 1-3 CPU cycles for addition and 1-7 CPU cycles for multiplication, to 17-69 cycles for division.
Bypass Delays
"switching between integer and floating-point instructions is not freeOne not-so-obvious thing related to calculation costs, is that switching between integer and floating-point instructions is not free. [Agner3] gives this cost (known as "bypass delay") at 0-3 CPU cycles depending on the CPU. Actually, the problem is more generic than that, and (depending on CPU) there can also be penalties for switching between vector (SSE) integer instructions and usual (scalar) integer instructions.
Optimisation hint: in performance-critical code, avoid mixing floating-point and integer calculations.
The next thing which we'll be discussing, is branching code. Branch (an if within your program) is essentially a comparison, plus a change in the program counter. While both these things are simple, there can be a significant cost associated with branching. Discussing why it is the case, is once again way too hardware-related (in particular, pipelining and speculative execution are two things involved here), but from the software developer's perspective it looks as follows:
if the CPU guesses correctly where the execution will go (that's before actually calculating condition of if), then cost of branching operation is about 1-2 CPU cycles.
however, if the CPU makes an incorrect guess – it results in CPU effectively "stalling"
The amount of this stall is estimated at 10-20 CPU cycles [Wikipedia.BranchPredictor], for recent Intel CPUs – around 15-20 CPU cycles [Agner3].
"on modern Intel CPUs branch prediction is always dynamic (or at least dominated by dynamic decisions)Let's note that while GCC's __builtin_expect() macro is widely believed to affect branch prediction – and it used to work this way just 15 years ago, it is no longer the case at least for Intel CPUs anymore (since Core 2 or so). As described in [Agner3], on modern Intel CPUs branch prediction is always dynamic (or at least dominated by dynamic decisions); this in turn, implies that __builtin_expect()-induced differences in the code are not expected to have any effect on branch prediction (on modern Intel CPUs, that is). However, __builtin_expect() still has effect on the way code is generated, as described in "Memory Access" section below.
Memory Access
"Back in 80s, it was possible to calculate the speed of the program just by looking at assembly.Back in 80s, CPU speed was comparable with memory latency (for example, Z80 CPU, running at 4MHz, spent 4 cycles on a register-register instruction, and 6 cycles on a register-memory instruction). At that time, it was possible to calculate the speed of the program just by looking at assembly.
Since that point, speeds of CPUs have grown by 3 orders of magnitude, while memory latency has improved only 10-30-fold or so. To deal with remaining 30x+ discrepancy, all kinds of caches were introduced. Modern CPU usually has 3 levels of caches. As a result, speed of memory access depends very significantly on the answer to "where the data we're trying to read, is residing?" The lower the cache level where your request was found – the faster you can get it.
L1 and L2 cache access times can be found in official documents such as [Intel.Skylake]; it lists access L1/L2/L3 times at 4/12/44 CPU cycles respectively (NB: these numbers vary slightly from one CPU model to another one). Actually, as mentioned in [Levinthal], L3 access times can go as high as 75 cycles if the cache line is shared with another core.
However, what is more difficult to find, is information about main RAM access times. [Levinthal] gives it at 60ns (~180 cycles if CPU is running at 3GHz).
Optimisation hint: DO improve data locality. For more discussion on it, see, for example, [NoBugs].
Besides memory reads, there are also memory writes. While intuitively write is perceived to be more expensive than read, most often it is not; the reason for it is simple – CPU doesn't need to wait for the write to complete before going forward (instead, it just starts writing – and goes ahead with the other business). This means that most of the time, CPU can perform memory write in ~1 cycle; this is consistent with my experience, and seems to correlate with [Agner4] reasonably well. On the other hand, if your system happens to be memory-bandwidth-bound, numbers can get EXTREMELY high; still, from what I've seen, having memory bandwidth overloaded by writes is a very rare occurrence, so I didn't reflect it on the diagram.
And besides data, there is also code.
Another optimisation hint: try to improve code locality too. This one is less obvious (and usually has less drastic effects on performance than poor data locality). Discussion on the ways to improve code locality can be found in [Drepper]; these ways include such things as inlining, and __builtin_expect().
Let's note that while __builtin_expect(), as mentioned above, doesn't have effect on branch prediction on Intel CPUs anymore, it still has an effect on the code layout, which in turn impacts code spatial locality. As a result, __builtin_expect() doesn't have effects which are too pronounced on modern Intel CPUs (on ARM – I have no idea TBH), but still can affect a thing or three performance-wise. Also there were reports that under MSVC, swapping if and else branches of if statement has effects which are similar to __builtin_expect() ones (with "likely" branch being the if branch of two-handed if), but make sure to take it with a good pinch of salt.
One further thing which is related to memory accesses and performance, is rarely observed on desktops (as it requires multi-socket machines – not to be confused with multi-core ones). As such, it is mostly server-land; however, it does affect memory access times significantly.
"When multiple sockets are involved, modern CPUs tend to implement so-called NUMA architecture, with each processor having its own RAMWhen multiple sockets are involved, modern CPUs tend to implement so-called NUMA architecture, with each processor (where "processor" = "that thing inserted into a socket") having its own RAM (opposed to earlier-age FSB architecture with shared FSB a.k.a. Front-Side Bus, and shared RAM). In spite of each of the CPUs having its own RAM, CPUs share RAM address space – and whenever one needs access to RAM physically located within another one – it is done by sending a request to another socket via ultra-fast protocol such as QPI or Hypertransport.
Surprisingly, this doesn't take as long as you might have expected – [Levinthal] gives the numbers of 100-300 CPU cycles if the data was in the remote CPU L3 cache, and of 100ns (~=300 cycles) if the data wasn't there, and remote CPU needed to go to its own main RAM for this data.
Sometimes (in particular, in non-blocking algorithms and while implementing mutexes), we want to use so-called atomic operations. In academy, only one atomic operation, known as CAS (Compare-And-Swap) is usually considered (on the grounds that everything else can be implemented via CAS); in real-world, there are usually more of them (see, for example, std::atomic in C++11, Interlocked*() functions in Windows, or __sync_*_and_*() in GCC/Linux). These operations are quite weird beasts – in particular, they require special CPU support to work properly. On x86/x64, appropriate ASM instructions are characterised by having LOCK prefix, so CAS on x86/x64 is usually written as LOCK CMPXCHG.
What matters from our current perspective is that these CAS-like operations are going to take significantly longer than usual memory access (to provide atomic guarantees, CPU needs to synchronise things at least between different cores – or in case of multi-socket configurations, also between different sockets).
[AlBahra] gives the cost of CAS operations at about 15-30 clock cycles (with little difference between x86 and IBM Power families). Let's note that this number is valid only when two assumptions stand: (a) we're working with a single-core configuration, and (b) that CAS-ed memory is already in L1 cache.
As for CAS costs in multi-socket NUMA configurations – I wasn't able to find the data about CAS, so I will need to speculate for the time being 🙁 . On the one hand, IMO it will be next-to-impossible to have latencies of CAS operation on "remote" memory less than round-trip of HyperTransport between the sockets, which in turn is comparable to the cost of NUMA L3 cache read. On the other hand, I don't really see the reasons to go higher than that :-). As a result, I am guesstimating the cost of NUMA different-socket CAS (and CAS-like) operations at around 100-300 CPU clock cycles.
Whenever we're working with modern CPUs and modern OS's, at app-level we are usually dealing with "virtual" address space; in other words – if we run 10 processes, each of these processes can (and probably will) have its own address 0x00000000. To support such isolation, CPUs implement so-called "virtual memory". In x86 world – it was first implemented via "protected mode" introduced as early as 1982 in 80286.
Usually, "virtual memory" works on per-page basis (for x86 each page is either 4K or 2M or at least in theory – even 1G(!) in size), with CPU being aware of the current process being run (!), and re-mapping virtual addresses into physical addresses – on each memory access, that is. Note that this re-mapping occurs completely behind the scenes, in a sense that all CPU registers (except for those specifically dealing with mapping) contain all the pointers in "virtual memory" format.
And as soon as we said "mapping" – well, the information about this mapping needs to be stored somewhere. Moreover, as this mapping (from virtual addresses into physical addresses) happens on each and every memory access – it needs to be Damn Fast. To help with it, a special kind of cache, known as Translation Lookaside Buffer (TLB) is normally used.
As for any type of cache, there is a cost of missing TLB; for x64 it is reported between 7-21 CPU cycles [7cpu]. Overall, TLBs are quite difficult to affect; however, a few recommendations can still be made in this regard:
once again – improving overall memory locality helps to reduce TLB misses too; the more local your data is – the less your chances are to get out of TLB.
consider using "huge pages" (those 2M pages on x64). The larger pages are – the less entries in TLB you'll need; on the other hand, using "huge pages" comes with some caveats, and as a result – is a two-edged sword. Which means that you need to make sure to test it for your specific app.
consider turning off ASLR (="Address Space Layout Randomization"). As discussed in [Drepper], enabling ASLR, while being good for security, hits performance, and exactly because of TLB misses too 🙁 .
Software Primitives
Now we're done with those things which are directly hardware-related, and will be speaking about certain things which are more software-related; still, they're really ubiquitous, so let's see how much we spend every time we're using them.
C/C++ Function Calls
First, let's see the cost of C/C++ function call. Actually, C/C++ caller does a damn lot of stuff before making a call – and callee makes another few things too.
[Efficient C++] estimates CPU costs for a function call at 25-250 CPU cycles depending on number of parameters; however, it is quite an old book, and I don't have a better reference of the same caliber 🙁 . On the other hand, from my experience, for a function with a reasonably small number of parameters, it is more like 15-30 cycles; this also seems to apply to non-Intel CPUs as measured by [eruskin].
"keep in mind that these days compilers tend to ignore inline specifications more often than notOptimisation hint: Use inline functions where applicable. However, keep in mind that these days compilers tend to ignore inline specifications more often than not 🙁 . Therefore, for really time-critical pieces of code you may want to consider __attribute__((always_inline)) for GCC, and __forceinline for MSVC compilers to make them do what you need. However, do NOT overuse this forced-inline stuff for not-so-critical pieces of code, it can make things worse rather easily.
BTW, in many cases gains from inlining can exceed simple removal of call costs. This happens because inlining enables quite a few additional optimisations (including those related to reordering to achieve the proper use of hardware pipeline). Also let's not forget that inlining improves spatial locality for the code – which tends to help a bit too (see, for example, [Drepper]).
Indirect and Virtual Calls
Discussion above was related to usual ("direct") function calls. Costs of indirect and virtual calls are known to be higher, and there is pretty much a consensus on that indirect call causes branching (however, as [Agner1] notes, as long as you happen to call the same function from the same point in code, branch predictors of modern CPUs are able to predict it pretty good; otherwise – you'll get a misprediction penalty of 10-30 cycles). As for virtual calls – it is one extra read (reading VMT pointer), so if everything is cached at this point (which it usually is), we're speaking about additional 4 CPU cycles or so.
On the other hand, practical measurements from [eruskin] show that the cost of virtual functions is roughly double of the direct call costs for small functions; within our margin of error (which is "an order of magnitude") this is quite consistent with the analysis above.
Curiously recurring template pattern The curiously recurring template pattern (CRTP) is an idiom in C++ in which a class X derives from a class template instantiation using X itself as template argument— Wikipedia —Optimisation hint: IF your virtual calls are expensive – in C++ you may want to think about using templates instead (implementing so-called compile-time polymorphism); CRTP is one (though not the only one) way of doing it.
These days, allocators as such can be quite fast; in particular, tcmalloc and ptmalloc2 allocators can take as little as 200-500 CPU cycles for allocation/deallocation of a small object [TCMalloc].
However, there is a significant caveat related to allocation – and adding to indirect costs of using allocations: allocation, as a Big Fat rule of thumb, reduces memory locality, which in turn adversely affects performance (due to uncached memory accesses described above). Just to illustrate how bad this can be in practice, we can take a look at a 20-line program in [NoBugs]; this program, when using vector<>, happens to be from 100x to 780x faster (depending on compiler and specific box) than an equivalent program using list<> – all because of poor memory locality of the latter :-(.
"In some real-world cases flattening your data structures can speed up your program as much as 5x.Optimisation hint: DO think about reducing number of allocations within your programs – especially if there is a stage when lots of work is done on a read-only data. In some real-world cases flattening your data structures (i.e. replacing allocated objects with packed ones) can speed up your program as much as 5x. A real-world story in this regard. Once upon a time, there was a program which used some gigabytes of RAM, which was deemed too much; ok, I rewrote it to a "flattened" version (i.e. each node was first constructed dynamically, and then an equivalent "flattened" read-only object was created in memory); the idea of "flattening" was to reduce memory footprint. When we ran the program, we observed that not only memory footprint was reduced by 2x (which was what we expected), but that also – as a very nice side effect – execution speed went up by 5x.
Kernel Calls
If our program runs under an operating system,1 then we have a whole bunch of system APIs. In practice,2 quite a few of those system calls cause kernel calls, which involve switches to kernel mode and back; this includes switching between different "protection rings" (on Intel CPU – usually between "ring 3" and "ring 0"). While this CPU-level switching back and forth itself takes only ~100 CPU cycles, other related overheads tend to make kernel calls much more expensive, so usual kernel call takes at least 1000-1500 CPU cycles 🙁 [Wikipedia.ProtectionRing].
1 yes, there are still programs which run without it
2 at least if we're speaking about more or less conventional OS
C++ Exceptions
These days, C++ exceptions are said to be zero-cost until thrown. Whether it is really zero – is still not 100% clear (IMO it is even unclear whether such a question can be asked at all), but it is certainly very close.
"these 'zero-cost until thrown' exception implementations come at the cost of a huge pile of work which needs to be done whenever an exception is thrownHowever, these "zero-cost until thrown" implementations come at the cost of a huge pile of work which needs to be done whenever an exception is thrown. Everybody agrees that the cost of exception thrown is huge, however (as usual) experimental data is scarce. Still, an experiment by [Ongaro] gives us a ballpark number of around 5000 CPU cycles (sic!). Moreover, in more complicated cases, I would expect it to take even more.
Return Error and Check
An ages-old alternative to exceptions is returning error codes and checking them at each level. While I don't have references for performance measurements of this kind of things, we already know enough to make a reasonable guesstimate. Let's take a closer look at it (we don't care much about performance in the case when error arises, so will concentrate on costs when everything is fine).
Basically, cost of return-and-check consists of three separate costs. The first one is the cost of conditional jump itself – and we can safely assume that 99+% of the time it will be predicted correctly; which means the cost of conditional jump in this case is around 1-2 cycles. The second cost is the cost of copying the error code around – and as long as it stays within the registers, it is a simple MOV – which is, given the circumstances, is 0 to 1 cycles (0 cycles means that MOV has no additional cost, as it is performed in parallel with some other stuff). The third cost is much less obvious – it is a cost of the extra register necessary to carry the error code; if we're out of registers – we'll need PUSH/POP pair (or a reasonable facsimile), which is in turn a write + L1 read, or 1+4 cycles. On the other hand, let's keep in mind that chances of PUSH/POP being necessary, vary from one platform to another one; for example, on x86 any realistic function would require them almost for sure; however, on x64 (which has double number of registers) – chances of PUSH/POP being necessary, go down significantly (and in quite a few cases, even if register is not completely free, making it available may be done by compiler cheaper than a dumb PUSH/POP).
Adding all three costs together, I'd guesstimate costs of return-error-code-and-check (in normal case) at anywhere between 1 and 7 CPU cycles. Which in turn means that if we have one exception per 10000 function calls – we're likely to be better with exceptions; however, if we have one exception per 100 function calls – we're likely to be better with error codes. In other words, we've just reconfirmed a very well-known best practice – "use exceptions only for abnormal situations" 🙂 .
Thread Context Switches
Last but certainly not least, we need to speak about costs of thread context switches. One problem with estimating them is that, well, it is very difficult to figure them out. Common wisdom tells that they're "damn expensive" (hey, there should be a reason why nginx outperforms Apache) – but how much this "damn expensive" is?
From my personal observations, the costs were at least 10000 CPU cycles; however, there are lots of sources which are giving MUCH lower numbers. In fact, however, it is all about "what exactly we're trying to measure". As noted in [LiEtAl], there are two different costs with relation to context switches.
The first cost is direct costs of thread context switching – and these are measured at about 2000 CPU cycles3
However, the second cost is MUCH higher; it is related to cache invalidation by the thread; according to [LiEtAl], it can be as large as 3M CPU clocks. In theory, with completely random access pattern, modern CPU with 12M of L3 cache (and taking penalty of the order of 50 cycles per access) can take a penalty of up to 10M cycles per context switch; still, in practice the penalties are usually somewhat lower than that, so the number of 1M from [LiEtAl] makes sense. This "much higher" estimate is also consistent with the number of spinlocks on x64 (which defaults to 4000 at least for Windows/x64): if it is usually beneficial to wait for 4000 iterations (amounting at the very least to 15-20K CPU cycles, and more like 40-50K cycles from what I've seen) reading that variable-which-is-currently-locked within a busy loop – just in hope that the variable will unlock before 4000 iterations is over, all of this trouble and CPU cycles merely to avoid a context switch – it means that the cost of the context switch is usually much higher than those tens-of-thousands-of-CPU-cycles-we're-ready-to-spend-in-a-busy-loop-doing-nothing-useful.
3 that is, if my math is correct when converting from microseconds into cycles
Phew, it was quite a bit of work to find references for all these more-or-less known observations.
Also please note that while I've honestly tried to collect all the related costs in one place (checking 3rd-party findings against my own experiences in the process), it is just a very first attempt at this, so if you find reasonably compelling evidence that certain item is wrong – please let me know, I will be happy to make the diagram more accurate.
[Agner4] Agner Fog, "Instruction tables. Lists of instruction latencies, throughputs and micro-operation breakdowns for Intel, AMD and VIA CPUs"
[Agner3] Agner Fog, "The microarchitecture of Intel, AMD and VIA CPUs. An optimization guide for assembly programmers and compiler makers"
[Intel.Skylake] "Intel® 64 and IA-32 Architectures Optimization Reference Manual", 2-6, Intel
[Levinthal] David Levinthal, "Performance Analysis Guide for Intel® CoreTM i7 Processor and Intel® XeonTM 5500 processors", 22
[NoBugs] 'No Bugs' Hare, "C++ for Games: Performance. Allocations and Data Locality"
[AlBahra] Samy Al Bahra, "Nonblocking Algorithms and Scalable Multicore Programming"
[eruskin] http://assemblyrequired.crashworks.org/how-slow-are-virtual-functions-really/
[Agner1] Agner Fog, "Optimizing software in C++. An optimization guide for Windows, Linux and Mac platforms"
[Efficient C++] Dov Bulka, David Mayhew, "Efficient C++: Performance Programming Techniques" , p. 115
[Drepper] Ulrich Drepper, "Memory part 5: What programmers can do", section 6.2.2
[7cpu] "Intel Sandy Bridge", 7-cpu.com
[TCMalloc] Sanjay Ghemawat, Paul Menage, "TCMalloc : Thread-Caching Malloc"
[Wikipedia.ProtectionRing] "Protection Ring", Wikipedia
[Ongaro] Diego Ongaro, "The Cost of Exceptions of C++"
[LiEtAl] Chuanpeng Li, Chen Ding, Kai Shen, "Quantifying The Cost of Context Switch"
« MOG Graphics 101: 3D Maths Basics, Meshes, Client- and Server-Side Polygon Counts
Game Graphics 101: Textures, UV Mapping, and Texture Filtering »
Filed Under: Optimizations, Programming Tagged With: C/C++, Cache, Locality, Multithreading, x86/x64
C++ for Games: Performance. Allocations and Data Locality C++ Performance: Common Wisdoms and Common "Wisdoms" Optimizing Big Number Arithmetic Without SSE Some Big-Os are Bigger Than Others Modified Harvard Architecture: Clarifying Confusion
ITHare (20)
Reddit (164 upvotes, 43 comments)
Hacker News (191 upvotes, 51 comments)
Martin Brandstatter says
I am quite surprised by to low cost of L1/L2/L3 cache misses .
What kind of CPU are you refering to ? Most likely top notch PC 🙂
I would be really interested how these (and all the others) look like on consoles PS3/4/NEO XBOX 360 , XBox ONE .
From my experience these are F***** expensive 😉
Wait, what is listed is not the cost of "cache miss" – it is time when it takes when there is a "hit". So to calculate cost of "L3 miss" – you need to subtract "L3 read" from "main RAM read" (and it can easily reach 100 cycles, which is quite a lot, especially as it can happen all the time).
Terry A Davis says
My operating system is ring-0-only and no paging(more or less) so my context switch is 930 cycles.
I've took a quick look at your OS, and I LOVE it :-). The problem, however, is that most of us still need to program for Windows (ouch) and/or Linux (which is getting bigger and bigger all the time – days of DamnSmallLinux which was able to do something useful in 4M of RAM, are long gone 🙁 ). 🙁
George Tsiros says
re: exceptions
their cost is not so significant because exceptions are (supposedly) used when otherwise a serious problem would occur (out of memory, division by zero, etc). In other words, an exception is (supposedly) raised when normal program execution can not continue. Please correct me if i am wrong.
You're right, though I am right too :-). I am speaking about cost per occurrence – and this cost is indeed damn high for exceptions. Which means that exceptions SHOULD NOT be used for anything which happens more than once in a long while. However, if somebody is careless enough to raise them 1M times per second – well, they will be in trouble. And this is perfectly consistent with what you've just said :-).
This cost is important to answer the question "what exactly qualifies as a 'normal' execution flow"; quite often it is not as obvious (as in "should we consider malformed incoming packet as normal occurrence or not?"); having this guesstimate, it is easier to answer such questions at least from performance point of view.
Risto Lankinen says
Regarding C++ Exceptions… if they cost only 5000 cycles then contrary to the common "wisdom" there can actually be times when they'd be quite efficient as a control structure! Think of a search algorithm which throws an 'Item' object (if the item was found) or an 'EndOfContainer' exception (if an item was not found). If your container automatically throws the exception when it's exhausted, you will save a boolean evaluation and a conditional jump (because the search can be hard-coded as an 'infinite' loop). So then, if your data structure contains tens of thousands (or more) items, the accumulated savings can easily exceed the cost of a throw.
"automatically throws the exception" – can you elaborate on how you're going to implement it? Do you mean playing around with VirtualAlloc()/mmap() and then relying on OS "access violation" exception (but this is quite different from C++ one) – or something different?
Rob Wilton says
Hi "No Bugs" Hare 🙂
I think that this is a great chart, and every software engineer should have a rough idea of these costs in their head when they are designing code.
One thing that might be a useful addition to your diagram is to add the cost of acquiring uncontended locks (e.g. a mutex and/or read/writer lock). I find that the cost of acquiring a shared read lock between two threads running on different CPUs can be quite large (because they need to read/update a count of the number of readers which can cause cache contention between the separate caches on the separate CPUs).
I know that lock acquiring/release on different-socket CPUs can be quite long, but I don't have any specific numbers on it 🙁 ; do you?
P.S. > I think that this is a great chart, and every software engineer should have a rough idea of these costs in their head when they are designing code.
Please compare the exception cost to realistic alternatives. You throw an exception and catch it, say, three function calls above.The alternative is at least 4 tests and alternatives. That leads to more code. Also, the stack unraveling code is ad hoc and not easily optimized.
That said, there is no excuse for walking the stack twice for a throw in "release"/"-o2″ mode.
I should say that comparing things as such is beyond the scope of this exercise (comparing all the pairs which might be of interest, would take way too long). On the other hand, answering a question "how much error-return-and-check costs" is well within the scope, so I've added it to the post (and will ask to add it to the picture too); while it is a guesstimate, I'm confident that – like anything else in this table – it stands with "within an order of magnitude" accuracy.
Basically, the cost of return-and-check seems to consist of three components: 1. cost of conditional jump (correctly predicted most of the time), 2. cost of R/R copying error code around, 3. cost of PUSH/POP to pass error code around if we're out of registers. Which adds up to 1-7 cycles (I've also added more detailed analysis to the post). In turn, it means that if we have one exception per 10000 calls with return-and-check, we'll be better with exceptions, and if we have one exception per 100 such calls – we'll probably be better with error codes. Which is perfectly consistent with long-standing "common wisdom"/"best practice" of "using exceptions only for error handling" (which BTW I've learned over 20 years ago from a 2nd edition of a certain book titled "The C++ Programming Language" :-)).
Charles L. Wilcox says
For the Exceptions vs. Return Code & Check comparison, in the latter case, assuming we are considering the cost of handling an error, the first cost, that of the conditional jump would *not* be predicted, and thus would cost the estimated 10-20 cycles. The error-case happens after a bunch of non-error-cases, so the branch predictor would continue to predict non-error. ( If there were a bunch of error-case paths before this, this is not an exceptional error at all. 🙂 )
( Great article; best info-graphic on this that I can remember. )
> that of the conditional jump would *not* be predicted, and thus would cost the estimated 10-20 cycles.
For the case when the error happens – sure, but for the case when it doesn't (and it should be 99.(9)% of the time) – it will be predicted. Therefore, to calculate costs of the "normal" case we need to count for prediction to be successful.
> ( Great article; best info-graphic on this that I can remember. )
Thanks! I like this one too 😉
Okay, 'Return Error and Check' doesn't clearly say it is the normal case.
I think it would be informative to have the 'Return Error and Check' exceptional case, along with the 'C++ Exceptions' normal case. As it stands right now, it looks like you are directly comparing the two, and that comparison is currently misleading.
You have a point – and I added a note about it being a normal case. Going into further details will be probably even more misleading :-(.
Thanks for the update. And understood; it's a complicated topic, deserving it's own post(s). 🙂
Josh Triplett says
Can you please include the costs of atomic operations, including both a simple "lock inc" or "lock xadd" and a full "lock cmpxchg"? For the costs of those, see Paul McKenney's work. (Note that the answers decreased significantly a few generations ago on Intel hardware, though those operations still take significantly longer than a normal instruction.)
This is one thing I'd very interested in myself, thanks a lot for the reference, I've already included it to the article and will add to the picture ASAP! On the other hand – I wasn't able to find information on the costs of CAS/atomics in multi-socket configurations, so needed to guesstimate (if you have any references about CAS on multi-socket NUMAs – please LMK).
> Note that the answers decreased significantly a few generations ago on Intel hardware
Let me guess – it happened around the time when FSB was abolished (and therefore bus lock was no longer necessary for sync) ;-).


Bjelde, A, Disser, Y, Hackfeld, J, Hansknecht, C, Lipmann, M, Meißner, J, … Stougie, L. (2017). Tight bounds for online TSP on the line. In Proceedings of the Annual ACM-SIAM Symposium on Discrete Algorithms (pp. 994–1005).


text:
Concealed Fury: Hélier Cisterne's 'Vandal'
By Q.V. Hough on February 16, 2015 • ( Leave a comment )
It's only been a couple days since I watched Hélier Cisterne's Vandal courtesy of iTunes' My French Film Fest, and I recently discovered that it's been 15 months since The Hollywood Reporter opened their review with these troubling words:
"While most people associate France with baguettes, berets and bad hygiene, the country actually has one of the world's most thriving street culture scenes, with a huge hip-hop following and, as anyone who's ventured into Paris' suburbs can attest, a landscape marked by graffiti."
In other words, the French youth embrace artistic expression like most kids of the modern world.
The subject matter of Cisterne's Vandal may indeed come as a shock to some (!), but it's essential to understanding how juvenile delinquents are coping across the world, or in places such as Los Angeles, Athens or the central location of Vandal — Strasbourg, France. With that being said, director Cisterne shines a light on emerging artistry, but doesn't quite fill out the canvas.
After numerous arrests, young Chérif (Zinedine Benchenine) leaves his mother exasperated and finds himself shipped off to live with his uncle. Strong male figure. Vocational school. This kid's about to get a reality check. And his disengaged father lives nearby. But what none of the adults understand is the establishment of an underground tagging group known as ORK. The leader? Chérif's somewhat nerdy cousin Thomas (Emile Berling), who introduces the new kid to an alternate type of rebellion; a contained rebellion. Street art.
As Chérif continues to struggle with the realities of everyday life, he finds peace in the group's nighttime excursions. They even have their own hideout where they admire VHS tapes of local artists, including the prolific "Vandal." He's the unidentified prophet of the streets; a man (or boy) respected through his ability to elude and tag. Although Chérif seems to understand the premise of ORK's activities, he reveals a few secrets to an admiring tomboy named Elodie (Chloé Lecerf). Rather innocently, the two classmates drop their guards around each other, which doesn't go unnoticed by the members of ORK — especially when Elodie winds up in the clubhouse. No chicks allowed, man!
Chérif fails to understand the gravity of his predicament, because he's always pointed a figure at somebody (or something) else. And that's when lightning strikes. Behold: The Book of ORK.
Visually, Cisterne's direction and Hichame Alaouie's cinematography offer a temp pass into the world of street art, but Vandal fails to explore the meaning behind tagging — just that it exists. Unfortunately, the supporting cast does little to stand out or highlight the genuine artistry behind such acts. Then again, a lack of emotion may explain ORK's attitude towards Chérif. In other neighborhoods, a code violation could lead to disastrous consequences, but this crew simply doesn't want to get caught. And they want to find Vandal.
Cisterne poses important questions about adolescent identity and touches on the blossoming of artistic expression, but the concealed fury of each character ultimately remains an enigma (along with their understanding of the real world).
Vandal is part of iTunes "My French Film Festival" and available for $1.99 through June 16.
-Q.V. Hough
Categories: 2015 Film Essays, Film Essays, Q.V. Hough, VOD
Tagged as: Athens, Chloé Lecerf, Emile Berling, Hélier Cisterne, Hichame Alaouie, iTunes, Los Angeles, My French Film Fest, Review, The Hollywood Reporter, Vandal, Zinedine Benchenine
Truffaut with a Shade of Demy: Axelle Ropert's 'Tirez la langue, mademoiselle'
Final Oscar Predictions

redpajama_set_name: RedPajamaCommonCrawl


- for information on outreach opportunities Click Here.
- contact us at edmvine@interbaun.com and tell us what type of ministry you are interested in!
- Please join us Sunday morning at 10:30. We'd love to meet you!
- Email transfer to edmvine@interbaun.com and specify "Harvest Vineyard". Supply your name and contact information for tax receipts.
- Mail in a cheque made out to "Harvest Vineyard": PO Box 20032 Beverly Stn, Edmonton, AB T5W 0Z9.
Thank you for your ongoing prayer and financial support that allows us to serve this church family and neighborhood.


A 20 Lap practice session, ideal for amateur karters to get to grips with karting and more experienced karters to brush up on their karting skills.
This event is not available on Saturdays.
Please note: Exclusivity of the race track is not offered to groups with less than 5 drivers during Timed Practice. Subsequently other junior drivers (8-12 yrs) may be on the circuit during the experience. Adults are not permitted to join F2 Racing sessions unless the booking is for 5+ drivers, rendering it a private booking.
A 40 Lap practice session, ideal for amateur karters to get to grips with karting and more experienced karters to brush up on their karting skills.
as the site have 2 different size karts.
As our site has 2 different size karts.
Please note that for this event adults and juniors (under 13's) cannot race together. Bookings must consist of either all adults or all juniors.
Young speed demons aged 4-7 years old will love the chance to tackle our awesome indoor track at the wheel of their 24V electric kart, capable of speeds up to 10mph! Up to 4 karts are available where your group will be given exclusive use of the track for 30 minutes, changing drivers at frequent intervals, and with an internal sound system replicating engine noise it will feel just like the real thing. For safety there is a remote cut-out switch and an additional seat for an accompanying adult.
4 children - £31.50 per person.
5 children - £26.99 per person.
6 children - £23.50 per person.
A 60 Lap practice session, ideal for amateur karters to get to grips with karting and more experienced karters to brush up on their karting skills.
A 5 lap non timed practice is followed by a 7 minute timed qualifying session. At the end of qualifying the drivers with the best lap times start the race from the front of the grid. Drivers then compete in a 40 lap race. A very popular event that echoes the real thrills of competitive racing. At race end each driver is provided with their individual performance statistics so you know who came out on top.
Grand Prix Elite - Monza!
This Grand Prix session consists of a 4 lap practice, then 5 qualifying heats of 6 laps each. In this event, points are awarded for the best lap times in each heat. At the end of the heats ALL drivers compete in an 8 lap semi-final, decided by 'first past the post'. The top drivers from the semi-finals then race in a 12 lap final. Popular with larger groups that may have a high proportion of first time drivers amongst them! An excellent Monza Grand Prix experience!
Strap yourself in and push the pedal to the metal- from the second that green light hits, you are going to be accelerating at lightning fast speeds across our intense circuit. For both first time drivers and experienced racers alike, this is the ultimate adrenaline fuelled karting experience, that we guarantee will leave you feeling like a future F1 superstar. With a fantastic two storey circuit for you to blast your way around, as well as computerized lap timers which can record your speed at up to 1/100th of a second, this is the closest you'll get to experiencing authentic racing thrills.
There are tons of transport links to get to our York site. You can find us easily just off the A1237 in Huntingdon, a short drive from the A1(M), which connects us to Leeds and Harrogate. Full travel information will be printed on your booking confirmation receipt.
I would strongly recommend karting here and would go again. I would also take my younger two sons who are 8 and 10 years old.
11 year old girls birthday part. They loved it. All the staff we're really good with the girls.
If you like a great 'adrenalin rush', then this is the ideal place to get it....!!!
It was a great Birthday treat and we really enjoyed it thanks to all the team for making it so good.
Booked for my son's 13th birthday.
All the kids had a super experience.
Fantastic experience for the kids!
Great time had the course to myself.


text:
Pes krátkouchý (Atelocynus microtis) je jihoamerická psovitá šelma, jediný zástupce rodu Atelocynus. Žije v nížinných deštných pralesích Amazonie, v oblastech neobývaných lidmi. Má tmavou červeno-hnědo-černo-šedou srst, krátké a štíhlé končetiny, krátké kulaté uši, huňatý ocas a štíhlý, dlouhý čenich, který připomíná liščí. Váží okolo 10 kg. Žije zřejmě samotářsky nebo v párech. Loví ryby, malé savce, brouky, žáby, ptáky a ještěrky. Často si pochutná i na ovoci. Mezinárodní svaz ochrany přírody ho hodnotí jako téměř ohrožený druh.

Systematika
Pes krátkouchý (Atelocynus microtis) byl popsán Philipem Lutley Sclaterem v roce 1883. Od té doby byl přeřazován do různých rodů (Lycalopex, Cerdocyon, Dusicyon) a měl různá vědecká jména. V roce 1931 byl poprvé zařazen do rodu Atelocynus, který však byl jistou dobu považován jen za podrod rodu Canis. V roce 1987 ukázala fylogenetická analýza, že jde o samostatný taxon, jehož nejbližší příbuzný je monotypický rod Speothos (pes pralesní). Genetická výbava druhu čítá 2n=76 chromozómů.

Výskyt
Pes krátkouchý se vyskytuje pouze na území Jižní Ameriky, kam se ze Severní Ameriky rozšířil po spojení obou kontinentů na konci pliocénu (nejpozději před 2,6 miliony lety). Žije ve státech Bolívie, Brazílie, Ekvádor, Kolumbie a Peru. Předpokládaný výskyt ve Venezuele nebyl nikdy potvrzen. Typickým biotopem tohoto druhu je amazonský nížinný deštný prales, nejčastěji do nadmořské výšky 1000 až 1200 metrů, s možným horním limitem okolo 2000 metrů. Rád se zdržuje poblíž vody. Hustota výskytu je podle všech indicií velmi nízká.

Popis

Pes krátkouchý je středně velká psovitá šelma s velkou hlavou a štíhlým protáhlým čumákem. Na délku měří 72 až 100 cm, ocas je 25 až 35 cm dlouhý. Výška v kohoutku dosahuje 35 až 36 cm. Váha se pohybuje mezi 9 a 10 kg. Lebka měří na délku okolo 16 až 17 cm. Zubní vzorec je 3/3-1/1-4/4-2/3. Uši má malé a zakulacené. Nohy jsou relativně krátké. Srst je krátká, hustá a tmavě zbarvená - nejčastěji v odstínech hnědé, tmavě šedé, černé či rudohnědé. Nejtmavší srst se táhne v hřbetní linii od hlavy po ocas. Rozliční jedinci mívají své individuální zbarvení a dosud není jasné, zda to nějak souvisí se stářím, ročním obdobím, pohlavím či habitatem, v němž žijí. Mezi prsty na nohou má pes malou membránu, jež mu zřejmě umožňuje lepší pohyb ve vodním prostředí. Ocas je relativně výrazně chlupatý v porovnání se srstí na těle. Samci vydávají z análních pachových žláz silný odér, samice ho neprodukují.

Ekologie a chování
K životu tohoto psovitého existuje jen málo spolehlivých informací. Některé poznatky byly získány na základě pozorování v zajetí žijících jedinců. Ve volné přírodě zřejmě žijí psi krátkouší v párech nebo osamoceně. Nejpočetnější pozorovaná skupina dospělých jedinců čítala tři kusy. Aktivní jsou převážně za denního světla, i když několikrát byli vyfotografováni i v noci. Vůči lidem se chovají většinou mírně, nicméně bylo už zaznamenáno několik případů, kdy se snažili člověka pokousat. Vydávají různé zvuky, například houkání podobné sovímu.

Potrava
Pes krátkouchý je stravovací oportunista, což znamená, že se příliš nespecializuje a živí se poměrně širokou škálou potravy. Nejdůležitější kořistí této šelmy jsou ryby. Dále konzumuje hmyz (především brouky), malé savce (hlodavce, agutiovité, vačnatce), kraby, ptáky, žáby a plazy. Ne nepodstatnou součást jídelníčku tvoří ovoce a jiný rostlinný materiál. Často loví ve vodě, nebo v jejím okolí. Dostane-li se do blízkosti lidských sídel, může napadat i drůbež. Loví osamoceně nebo v párech.

Rozmnožování
Informace o rozmnožování těchto psů jsou velmi kusé. Předpokládá se, že mláďata se rodí nejčastěji mezi dubnem a prosincem. Doupata si psi zřizují v dutinách velkých stromů, případně v doupatech po jiných zvířatech (např. pásovcích či pakách). Počet mláďat v jednom vrhu se zřejmě pohybuje okolo 2 až 3. Informace k páření, době březosti, rození a výchově mláďat, odstavu a dalších podrobnostech neexistují. Samci dosahují pohlavní zralosti okolo 3 let, kdy jim sestoupí varlata.

Predace, dožití
Předpokládá se, že predátory těchto psů můžou být větší kočkovité šelmy, jako je ocelot a puma. Potvrzenými predátory jsou jaguár a hroznýš.

Délka života v přírodě je neznámá, zvířata v zajetí žila 9 až 11 let.

Hrozby, vztah s lidmi
Hlavní hrozby pro tento druh jsou ztráta habitatu vlivem masivního kácení deštných lesů a s tím související úbytek přirozené kořisti. Další potenciální hrozbou může být rozšíření nepůvodních chorob. Neexistují žádné údaje k nějakému rozsáhlejšímu pronásledování tohoto psa ze strany lidí. Občas je zřejmě loven kvůli jídlu.

Mezinárodní svaz ochrany přírody ho vyhodnocuje jako téměř ohrožený druh, když konstatuje odhadovaný úbytek 20 až 25 % zvířat v prvních 12 letech 21. století a zároveň očekává při příštím hodnocení posun mezi zranitelné druhy.

Mezi domorodými obyvateli Amazonie je povědomí o této šelmě velmi malé, není to živočich s nějakým zvláštním významem. Někteří domorodci z Ekvádoru uvedli, že patří mezi zvířata, která neloví, ale nedokázali vysvětlit proč. Amarakaeriové, domorodci z Peru, ho nazývají huiwa toto, což znamená "ďábel samotář", a věří, že útočí na muže tak, že jim kouše do varlat.

Chov v zajetí
V současnosti nežije v oficiálních zoo žádný pes krátkouchý. Celkem existují záznamy o dvanácti jedincích chovaných v různých zoologických zahradách (Londýn, Para, Schönbrunn, dále několik zoo v USA). Někdy jsou odchycená zvířata chována v zajetí přímo v zemích původu. Jeden nalezenec pojmenovaný Oso a vychovaný v zajetí pomohl vědcům s výzkumem chování svého druhu.

Reference

Externí odkazy

Psovití
Fauna Jižní Ameriky

redpajama_set_name: RedPajamaWikipedia


The Lord of the Rings: Aragorn's Quest is an action-adventure video game released on 14 September, 2010 for Wii, Nintendo DS, PS2, PS3 and PSP. It was developed by Headstrong Games and published by Warner Bros. Interactive Entertainment.
The Lord of the Rings: Aragorn's Quest free game allows the player to gather the three books and extract the events written therein. With the help of these events, he is required to guide a young hobbit throughout The Shire. On the other hand, it is necessary for the hobbit to listen to the stories told by Samwise Gamgee of Aragorn. If he follows the stories, then the levels in the game will be designed. And the player assumes the role of Aragon in a third-person perspective.
The Lord of the Rings: Aragorn's Quest full game is set in The Shire (the hub world) and much of it includes combat fought with the sword, spear, archery and horse-mounted combat. If the player is playing the game on Wii and PS3, it is possible for him that he can dismiss and start playing as Gandalf at playing the game. But DS, PS2, or PSP are void of this feature. Moreover, there is an arena in these platforms. However, it is not included in the multiplayer mode. There is a difference in perspective and controls between the versions.


text:
Q: Uncaught SyntaxError: Unexpected token ILLEGAL on Toggle I am getting this error when I try to use the toggle function.  It might be because of <%=i%> but I'm not sure
<% @categorias.each do |categoria| %>
  <%i += 1%>
  <div id = "Categoria" onclick = "$(#<%=i%>).toggle();">
     <%= categoria.categoria_pt %>

  <% @pratos_precos.each do |pratos_preco| %>
    <% if @pratos.find(pratos_preco.prato_id).categoria_pratos_id.to_s == categoria.id.to_s %>
      <div id = <%=i%> style = "display:none">

            <%= @pratos.find(pratos_preco.prato_id).nome_pt %>

I get that error when I click on the Category div, but I don't know why.
If I do it like this:
<div id = "Categoria" onclick = "$( "#<%=i%>" ).toggle();">

I get this error:
 Uncaught SyntaxError: Unexpected token }

A: Try this code:
<% @categorias.each do |categoria| %>
  <% i += 1 %>
  <div id = "Categoria" onclick = "$('#<%= i %>').toggle();">
    <%= categoria.categoria_pt %>

  <% @pratos_precos.each do |pratos_preco| %>
    <% if @pratos.find(pratos_preco.prato_id).categoria_pratos_id.to_s == categoria.id.to_s %>
      <div id = "<%= i %>" style = "display:none">

          <%= @pratos.find(pratos_preco.prato_id).nome_pt %>

You'll notice that the #<%= i %> section is now surrounded in single quotes to make the resulting jQuery selector valid.  Single quotes are used instead of double quotes, as double quotes are already surrounding the onclick handler, which includes the jQuery selector.
Also, the line with <div id = "<%= i %>" style = "display:none"> now uses double quotes around the id value, as per HTML specs.
With those two changes, it looks like this should work as expected.

redpajama_set_name: RedPajamaStackExchange


text:
Adventurer's Corner
These are our adventures…
Chronicles of Netheril
Character Backgrounds
Magic Item Histories
Quest List
Shops for Loudwater
RAWR Page
Soulhers Page
Upcoming Campaigns Page
↑ Return to Chronicles of Netheril
SPEED – MagicRapier
A hundred years ago, during the Spellplague, magic went crazy. This affected most magically enhanced weapons as well. Thus were the famous Drow Elf Ranger, Drizzt Do'Urden's prized scimitars, Twinkle and Icingdeath – crazy. The hero's blades had lost all enhancements for a time, forcing Drizzt to rely only on his skill alone. Normally, this would suffice, but the drow was being hunted by a Shadar-Kai, a creature from the Shadowfell. No one knows why Drizzt was being hunted by the Shadar-Kai, but nevertheless, it was a very fast creature. Drizzt simply had to avoid it as best he could. Even his trusty panther, Guenhwyvar, could not aid him, for the magic that brought him to the realms did not work either.
So it was that Drizzt pleaded with Malchor Harpell to give him a blade that did not rely on the weave to work, and that would make him quicker and able to act sooner than the Shadar-kai hunting him. Thus did Malchor enchant a rapier with the ability to do so, and gave it as a gift to Drizzt.
Then did the hunter become the hunted, as Drizzt tracked down the Shadar-Kai, and swiftly plunged Speed into the dark creature. Not long after did Twinkle and Icingdeath regain their magical properties, so Drizzt left Speed into the corpse of the Shadar-kai, as its essence was returned to the Shadowfell, leaving Speed behind in the meadows to eventually be found by another.
DOUBLE – Magic Paired Dagger
Known for her sleight of hands, Nathinel Silmerhelve, noble of Waterdeep during the day, cunning rogue at night, partook in many forays into Undermountain. Her group of adventurers, nobles all, would take the plunge in the big well in the Yawning Portal Inn on a regular basis, exploring the catacombs deep beneath the streets of Waterdeep.
Many drunks would bet on how long they would stay down there, as well as whether or not they would return at all.
Nathinel fought valiantly against evil denizens, and oftentimes vanquished the more intelligent creatures by grasping her dagger with both hands and suddenly splitting it in two, chucking both into their faces full of surprise.
Nathinel eventually found her end along with her companions when they decided to finally explore some of the deeper tunnels of Undermountain, losing her magical dagger deep within.
SUB-K – Magic Sickle
Passed around among the many farmers of the dalelands over the years, this sickle was subtly used both to harvest grain and to defend the farms from various invaders. Most farmers cleaned it before using it for harvesting, but some dalefolk speak of the occasional bread with an odd flavor and a red tinge to it…
LUCKY – Magic Katar
Orist Moonbow, deceased elf harper was known to have once possessed one of the Daggers of Ochiir Naal, and subsequently gave it up by losing in a game of "The Ball Game" to a group of dwarves. This all occurred while he was in New Waterdeep, part of a colonization effort over in Maztica (a continent that traded places with Returned Abeir during the Spellplague).
Thus did he steal a weapon of the locals in order to be able to defend himself should the need arise. However it was that he managed to get hold of this without injuring himself is not known, but he was definitely lucky to do so. He was also lucky in that they did not seek him out to slay him outright for this transgression. Unfortunately, his luck ran out, for on his sea voyage home to Baldur's Gate, his ship capsized and he was never heard from by the Harpers again.
QUICKY – Magic Kukri
A young Strongheart Halfling warrior from long lost Luiren by the name of Semajis Bligith once held this very blade. Not only was he known to quickly cut down goblin after goblin with Quicky in one hand and a paired kukri in the other, but also for the distinct fact of always smoking a pipe and chewing on old cheese while doing so.
Semajis was a semi-famous adventurer from Luiren, protecting his homeland from hordes of goblin invaders. With two Kukris in hand, he was a sight to behold, cutting anything and everything down that dared to attack his home.
The heroic Halfling disappeared while away from his home on a quest. He sought to find a legendary artifact of Arvoreen, who was then the Halfling deity of protection and vigilance. Rumor has it that his quest brought him to Mulhorand, a land lost during the Spellplague. As Abeir collided with Toril during this historic event, lands of Abeir merged with lands of Toril, changing the landscape of both worlds. It is rumored that Semajis ended up in Abeir, but in the process, dropped his Kukri, which was later found by a Dragonborn warrior who had come from Abeir. What came to be of Semajis is yet unknown…
SHIELD – Magic Parrying Dagger
When Myth Drannor was reclaime by the elves, an epic battle took place between an ancient demonic baatezu and a heroic eladrin bladesinger. The bladesinger and the baatezu fought into the clouds above the realm, clashing steel and spell. The eladrin spent all his magic in this battle, cackling lighting into the demonic being.
Eventually, his repertoire ran out. Stuck with his Moonblade in one hand and no spells left to sling with his empty left hand, he began to worry that he would not be able to vanquish the demon.
The demon laughed with glee as he knew the situation was grim for the eladrin. It took out its flaming whip, holding it in one hand and its massive jagged blade in the other. The odds were against the bladesinger then and there.
But a gift from Corellon himself was tucked away neatly in his boot. As the demon cracked its whip at him, the eladrin unsheathed a parrying dagger from his boot and caught the whip with it. This stunned the demon long enough to give him time to plunge his Moonblade into its heart, sending it back to whichever of the Nine Hells it came from.
It is believed that this victory was pivotal in the elves finally reclaiming Myth Drannor, and it would not have been possible without this very effective defensive weapon.
FIRESHOT – Magic Longbow
This fine bow crafted by the Star Elves of the east was enchanted by one Estagud, former red wizard of Thay, by tapping into the elemental chaos. Estagud was angry with the Tharchions and hated the life in Thay. The turning point of his hate was when Szass Tam flooded Thay with undead, taking over as sole ruler of the land. Not only that, the exclusive worship of Bane was something he could not stand for.
So did he enchant this bow that he received from a Star Elf friend of his, with the fiery vengeance of Kossuth, ruler of flames, in mind to burn any foul undead creature roaming the lands of Thay. He gave this to the Star elves so that they could accomplish this task for him, due to his lack of skill with a bow.
The task still incomplete, it is surely his hope that another one day takes up Fireshot and finishes his task.
DEATH COMETH – Magic Fullblade
Among those residing in Berdusk during the Time of Troubles were the Harpers of Harper Hall. One among these people was Vadagar, a man whose youth working at his father's forge resulted in corded muscles covering his entire frame.
His natural strength led him to be recruited by the not-so-secret organization for good, dedicated to preserving history, lore, magic and ridding the lands of evil. Mostly comprised of Bards and Rangers, people of other skills were part of the harpers to perform other duties. Vadagar was recruited to slay Zhentarim orcs from Darkhold.
If there was anything Vadagar hated, it was orcs. And Zhentarim slavers. Posing as mere merchants, the Zhentarim were an evil trade and slaving consortium that attempted to have a monopoly on these in the realms. Led by powerful wizards and priests of Bane, many people feared the Zhents.
Vadagar's hate was channeled into his forging of a blade large enough to complement his own strength and that would enhance his ability to single out his enemies, bringing death upon any who sought to escape his wrath.
Many Zhentarim orcs had their deaths come at the hands of Vadagar and his mighty blade, and thus does it bear its name still today.
Except where otherwise noted, content on this site is licensed under a Creative Commons License.
Creative Commons License BY-NC-ND


Vancouver Coastal Health is warning anyone who went to the Skookum Festival, visited Noodlebox Mount Pleasant or the Outdoor Community Block Party, or used public transit in Vancouver during specific times about a possible exposure to measles.
Vancouver Coastal Health is warning anyone who went to Skookum Festival last weekend, visited Noodlebox Mount Pleasant or an outdoor block party on Quebec Ave, about a possible exposure to measles.
The warning also extends to people who used public transit during specific times recently.
An individual who attended the festival has been confirmed to have measles, a highly infectious disease that is spread through the air.
"The unfortunate thing about measles is that it can be infectious before people know that they're infected with it," said Dr. John Harding, a medical health officer with VCH.
"This particular individual didn't know that they had come into contact with measles in the past, so unfortunately by the time we find out that it's measles, it's already been too late and some people have been exposed."
People who are not fully immunized against measles, or who have never had the disease, are at risk of contracting the disease.
If you were at any of the locations during the times listed below, and you have not been fully immunized with two doses of a measles vaccine such as the measles, mumps, rubella (MMR) vaccine, nor have had measles in the past, then you should see your doctor immediately.
Skookum Festival, Stanley Park, 5 p.m. – 1 a.m.
Aquabus from Olympic Village to Hornby Street, approximate trip start was 3 p.m.
Canada Line SkyTrain from Vancouver City Centre to Broadway-City Hall Station, 11 p.m. – 1 a.m.
Outdoor Community Block Party at 1188 Quebec Street, 1 p.m. – 3 p.m.
Main Street bus from Terminal Station to Broadway, 3 p.m. – 5 p.m.
Noodlebox Mount Pleasant (2511 Main Street) – Noon – 6 p.m.
VCH said measles can stay active in the airspace for two hours after an infected individual has left a location.
Anyone who may have contracted measles from this exposure on the dates listed above would begin developing these symptoms between Sept. 15 and Sept. 29.
If you think you have been exposed and are not immune to measles, you should get immunized within six days of exposure to prevent getting the disease.
Most people in B.C. are immune to measles because they've had two doses of the MMR vaccine or they've had the illness in the past.
If you were born before January 1, 1970, you are likely to be immune. If you were born between 1970 and 1994, or grew up outside of B.C., you may have received only one dose of the MMR vaccine and require a second dose to be fully protected.
You can get the vaccine for free at your doctor's office, your pharmacist, or local community health centre (for adults and kids over five).
Infants under one year of age, pregnant women, and people with immune problems should not get the MMR vaccine and instead immediately consult their doctor or call Vancouver Coastal Health, Public Health, at 604-675-3900.
People who develop symptoms should see a doctor, and ensure that they call the doctor's office before going, so precautions can be taken to protect other patients.
People with symptoms should also report their illness to VCH Public Health at 604-675-3900.


Semisolid. Made in your choice of milk, dark, white or sugar free chocolate.Package on top of a gold..
With edible gold color dust on wings. Trimmed in Clear Cellophane. Choice of Color Ribbo..
Made in your choice of milk, dark, white or sugar free chocolate.Hand decorated with edible gold dus..
3 Dimensional chocolate Cocker Spaniel dog made in your choice of milk, dark or white chocolate. Sem..
3 Dimensional chocolate Dashund (milk, dark or white chocolate).Semi-solid placed on top of a cake b..
Made in your choice of milk, dark or white chocolate.Hand painted with white chocolate.With your cho..
Dragon Egg (Hollow) hand made in your choice of milk or dark chocolate.Hand painted with edible gree..
Hollow. Made in your choice of milk, dark or white chocolate.With your choice of ribbon color for an..


Science Archives - Biology Fortified Inc.
I wanted to give a detailed overview explaining the challenges that farmers face with viral plant diseases, methods of control, and approaches to engineering resistance.
What biotechnology issues resonate with students?
What should non-experts know about genetic technologies in order to make informed decisions? I conducted a study to answer these questions, and here is what I found.
Aloha! We are asking for your help in bringing top-notch training in science communication to the next generation of students and scientists.
Biology Fortified hosted a live, public webinar as an introduction to science communication, particularly aimed at young scientists and science enthusiasts. Learn about psychology, ethics, effective strategies, and how to network to help your communication efforts achieve the greatest impact.


With the possible exception of the commissioner himself, there's nobody better to talk to from Major League Baseball about the new partnership with the Atlantic League to use experimental rule changes and equipment than Morgan Sword.
Sword was the point man on the MLB side in making this happen in negotiations with the Atlantic League.
Over the past few days, a lot has come to light through reporting on this website on not only what the Atlantic League can gain from the recently announced set of rule changes, but also how much of it will be implemented.
What you haven't seen yet, however, past a single quote from Sword himself in the press release, is what Major League Baseball feels like this does for them.
"We identified the Atlantic League in the off-season as a good fit for us. Our minor leagues are generally not a great place for us to do that because the focus in the environment is on player development and developing players to play in the major leagues. This deal offered us the opportunity to see some of these rules brought to life in an unaffiliated environment.
This part of that agreement, however, was one of that was a long time in the making.
Historically, as a whole, Major League Baseball hasn't cared about independent baseball. Not one bit. Hasn't acknowledged it. Has had their teams refuse to acknowledge the playing time of those who'd come through it to return to a major-league organization.
In short, "indy ball" hasn't been so much as a blip on MLB's radar in the past. That very much so changes with this arrangement.
Can we be honest here for a second? The reaction from the Atlantic League side to much of these changes has been negative. To be clear, that's not coming from the team side, but from players who are concerned about how the changes will affect their careers — and to be more clear, nobody's blaming them for feeling that way at all — as well as fans who are tired of seeing the game they love get continually poked, prodded and tinkered with.
The reaction from the big league side, at least from the corporate side of things, as you'd expect, has been more consistently positive.
Of the numerous concerns players have expressed, a prominent one has been the assumption that many of the changes will never see the light of day in the big leagues. From the MLB side, until these potential changes do get tested, it's too early to make that determination on their end.
As referenced in the two-part conversation with Rick White, the desire for an increase in "true outcomes" was a large part of the genesis of trying to create this relationship, and thus, these changes in the first place.
Whether it is or isn't remains to be seen. What's likely more of a given is seeing future changes rolled out over time. What's the future for this in the eyes of MLB?
So where does that leave things now? As mentioned, players have been extremely hesitant to be willing to adapt to some of these changes, specifically the pitching mound distance change.
In short, as MLB sees it, the positives for all involved, and that very much so includes all Atlantic League players, outweigh any perceived negatives here.
"From our point of view, the radar-tracking systems that are going to be installed in Atlantic League stadiums are going to provide an unprecedented level of information to MLB scouts," Sword said.
Posted in Uncategorized on March 12, 2019 by Mike Ashmore.


text:
Tales of Blagg the Axman Dec 02 2006
Long-Ago Nights and King's Lights
By Blagg the Axman
Candy, 3 Needles, The Nativity Story, Flannel Pajamas, 10 Items or Less, Turistas and Zen Noir
Moving the Show: A Field Trip Deconstructed
Big Brother: Where do you live in Chicago?
Josh Kalis: In Wicker Park.
BB: What's up with that area?
JK: It's cool. Maybe about five years ago I wouldn't have been able to live there. It was too crazy because of all the gangsters and shit, but now it's cool.
BB: What's with that hand-signal shit you were telling me about?
JK: Yeah, you got to be careful, man. I mean, everything from when you take your shirt off and what shoulder you rest your shirt on — your right or left shoulder — to waiting for the bus and if you got your arms crossed, which way your arms are crossed, all the way to when you're holding your arms down in front of you — you got to realize what hand is in front of the other. You've got to be careful with that shit, 'cause they will definitely pop you — no questions asked.
BB: Do you still wear a cap?
JK: Nah, I don't ever wear my cap in Chicago. There are too many colors, too many lefts and rights. In certain areas that shit is cool, but not in Chicago.
— Big Brother Magazine, September, 1997
Though the sun sinks below the horizon, the air grows warmer. Rests are becoming less frequent, and the air's chilly bite loosens. We are beginning to walk out of the mountains.
The boy noticed some time ago. There is a growing spring in his step, even as he tries to hide it. We are speaking to one another again, but an unspoken awkwardness remains. The recent battle with the ogre revealed that we had perhaps misjudged one another — fairly or not — and it seems to have given us pause, as we reevaluate one another.
It makes sense. I failed Alfie in his time of need, while he employed heroism worthy of a warrior, nevermind a malnourished sapling of a lad.
He ranges far ahead now, emboldened by the climbing temperature and, possibly, a newfound confidence. I have humored him, but now raise my hand. "Hold," I call. "We stop here for the night."
Belly full and body aching, I stare into the fading embers of the fire with half-lidded eyes. My kingdom for a pipe of smoke, I think to myself. Would that I had a kingdom. My ax for a pipe? Perhaps. Perhaps not...
There was another night like this, so long ago. Stumbling toward a dim orange glow, half-conscious, bruised and wracked with fatigue and much battle.
"Who goes?" the first voice cried, and if I hadn't known it already, it was then that I should have realized all was lost. The voice was plaintive — it was the voice of a man on the defensive.
I didn't answer. Couldn't, probably. Shuffling forward, my bleary vision fixed upon the ground, moving steadily toward the glow of the firelight. In this land, fire meant soldiers — all others fled or were cut down days ago. If they were for Mandrake, I would live. If they were Kayne's, I would probably die. That night I was ready for either fate.
Several figures rushed to my side and bore me toward the light, where my armor was removed and my wounds treated as I passed into sleep. When I woke it was light again, and I was being carried on a makeshift litter. Green was everywhere, treetops. "Good-man," I rasped, my tongue chalky and dry, "where am I?"
The fellow on the litter's rear raised one finger to his lips — shhhhhhh — but seconds later a man's voice called out and all was still. An arrow protruded from the neck of the soldier carrying my litter, and dark blood bubbled from his mouth as his eyes glazed. He collapsed and my stretcher fell, blurred forms running all about, and seconds later I was raised up and carried off at a full sprint. Darkness reclaimed me.
Two more days I slept, so I was told. They made camp in a small cave along the bank of a creek, where there were fish to eat and the Dark Lord's hounds could not so easily catch our scent. Nine men remained from a platoon numbering near 80.
For their part, they had done better than my unit — I was the sole survivor.
"Blagg," said the captain, named Trimbley, when my wits returned. "What can you tell us? What news from the front?"
I glanced at him and chewed my fish. "There is no front."
Trimbley looked away.
Indeed, the writing was on the wall. Neither friendly horseman nor runner had been sighted for nigh a week. The King's ranks were scattered, with errant soldiers wandering the wasted land during the day and hiding at night, when Kayne's black-booted armies roamed. There were whispers that entire towns had been burned down to the earth, that the Dark Lord had taken the capital itself, its streets strewn with festering corpses.
A week we stayed by the river. On the third day, two more men were brought in by the watch. "Not sure what happened to the others," one whispered as he shivered over a cup of thin coffee. "We were taken by surprise, at night" — he looked around — "there was nothing for it but to fly." A sob caught in his throat and he cast his eyes downward.
Trimbley laid a hand upon the man's shoulder. "It's alright. We've all the same tale."
Shaking his head, the stranger pointed to where I sat in the corner. "Not that one," he said. "Outnumbered nearly three to one. The bodies on the field told the story true enough. The Axman didn't fall."
"No," I murmured, rising to leave. "I fell not. But spare your petty exaltation for the threescore men who died around me and surely lived better lives than I."
That night we heard them, across the river. They passed close, well over a hundred, perhaps two hundred. As ever, there were no torches, no horns, no war-cries. Only bootheels, crunching ceaseless in the dark.
On the last morning Trimbley came to me as I fished upstream. "Axman," he began, his eyes nervously searching the forest, looking perhaps for the words he'd prepared. I cast my spear upon the shore. "Tell me your mind, captain."
"Some of the men..." he trailed off and several passed moments before he resumed. "How long can we stay here, Blagg? They'll find us, certain."
"You speak true," I said, nodding. "And I have considered it. If we strike for the west, an hour ere the sun rises—"
Trimbley shook his head. "No, Axman, you misunderstand me." He took a deep breath. "An hour ago. Warwick brought him in. Another survivor. The capital has fallen, Blagg. Kayne calls for total surrender. This fellow says—"
It was enough. I pushed past him, striding toward the cave as Trimbley called for me to wait. A part of my mind marked the man a fool for endangering our position in hostile country, but we were far beyond that now. In the cave sat the newcomer, clad in rags and wild-eyed. The men watched as I crossed the room and put my hand to the ax-handle.
Trimbley was there now, pleading as I brushed him aside and stood in the mouth of the cave. "Who among you would turn your back on your king?" I said, my voice cold and even. "Who among you would kneel before the treacherous liar Kayne, cold-blooded murderer of King Mandrake, and swear allegiance? Stretch your neck before me now that I might give you the honorable death that you ill deserve."
Twelve men looked at me on that riverbank, measuring the weight of my words and the changed world outside that damp, stinking cave. The water rushed by and not a word was said.
"So it shall be," I murmured. "Then I shall have to slay you all."
"Blagg, please," Trimbley once more stood before me, his hands clasped. "These men — us — we have families... we did have families... they're good men Blagg, but they're not born warriors."
"Perhaps they should have stayed away from war, then."
They were frightened. "I don't ask your forgiveness," Trimbley continued, "and I do not ask that you understand. I ask only that you look upon these men with the grace that our departed king once showed his own men." He gave me a knowing look. "Even when perhaps they did not deserve it."
My ax fell and I stepped away, hiding the tears that sprang so quick to my eyes. For a moment I watched the river, wondering how many kingdoms had risen and decayed while it ran past these shores. With set jaw, I gathered what was left of my equipment and made to leave.
The newcomer Warwick approached me as I left the cave for the last time. "I'm sorry, Axman," he said. "Forgive us."
I gave him a curt nod and bade them farewell. "Return as you will to the lives you had before this evil came to the land, if you are able. But know that all is now eggshell and spring-ice — fragile and yielding to the hand of the dark one who now holds this kingdom in sway. You live as suits his twisted purposes, and can expect no mercy. The years ahead promise much strife, but I wish you good fortune in spite of all."
"Blagg," Trimbley said. "Where will you go?"
"Does it matter?" I stepped into the river, the icy water filling my boot, and faced them again. "My conscience is clear, and I still serve my king."
The fire has gone, and as I fade to slumber there is a new glow on the horizon — purple, shifting to blue, shifting to green, flowing across the murky night sky. As children, we used to call them "King's Lights."
A former mercenary for hire, Blagg is an axman by trade and still carries the banner of King Mandrake, the once and true ruler of the realm. Gapers Block readers are invited to contact Blagg for advice, insight and recommendations at blagg@gapersblock.com. His column appears every other Saturday.
...has moved to our new section, Mechanics


text:
EU ripostes as Trump kicks off transatlantic trade war
Brussels (AFP) –
The EU on Thursday vowed unity and to retaliate swiftly against the Trump administration's harsh tariffs on steel and aluminium imports as Europe blasted Washington's 'America First' protectionism.
European powers had for months hoped to lure US President Donald Trump away from his tariff threat, but now faced the harsh reality of a looming trade war with their transatlantic ally.
German Chancellor Angela Merkel slammed the shock duties as "illegal" and said they risked sparking a disastrous "spiral" of retaliatory measures.
Europe will respond in a "firm and united" way to US tariffs, Merkel said with the pressure higher than ever to mend differences within the EU on how to tackle the Trump threat.
Export powerhouse Germany is highly reluctant to deepen the trade war, and until the last minute hoped to reason with Trump.
Instead, the American president ignored Germany's pleas and doubled down on protectionism by threatening a separate wave of duties on car imports in a direct affront to German automakers.
France had defended a tougher line, rejecting any serious talks on trade with the US until the tariff threat lifted.
But now,"it is important that the European response is as coordinated as possible," a French ministry source said.
- 'Bad day' -
"This is a bad day for the world trade," European Commission President Juncker told a conference in Brussels after Washington said new tariffs would be effective from 0400 GMT Friday.
"The European Union cannot react to that without any kind of reaction," said Juncker, whose commission handles trade matters for the 28 member states.
In anticipation, the EU already drew up a long list of counter-measures against the US, which include equivalent duties on a whole range of products including cranberries, motorcycles and bourbon whiskey.
As a precautionary measure, the commission, notified the World Trade Organization of eventual counter duties on May 18 that could come into force 30 days later and would affect some 2.8 billion euros in products.
The commission is now detailing those measures, but the final decision to greenlight the counter-measures falls to the EU's 28 member states, where the split views will be tested.
- 'Europe united' -
Juncker said that the EU would also launch a dispute settlement procedure against the United States at the WTO, a legal process that could take years.
Juncker's trade commissioner Cecilia Malmstrom said the EU had tried "everything to avoid this outcome" in talks with President Trump's administration over the last two months.
"I have argued for the EU and the US to engage in a positive transatlantic trade agenda, and for the EU to be fully, permanently and unconditionally exempted from these tariffs," the Swedish commissioner said.
"This is also what EU leaders have asked for," she added.
Malmstrom said the US side tried to use the threat of sanctions as "leverage to obtain concessions" from the EU but added "this is not the way we do business," especially between longstanding allies.
"Now that we have clarity, the EU's response will be proportionate and in accordance with WTO rules," she added.
In Washington, US Commerce Secretary Wilbur Ross said the Trump administration was following through on its threat to impose metal tariffs on not just the EU, but also Canada and Mexico.
Ross said talks with the EU had failed to reach a satisfactory agreement to convince Washington to continue the exemption from the tariffs imposed in March.
This effort included a failed offer by European leaders to negotiate a limited EU-US trade deal as well as open up the European market to US natural gas -- but only if an exemption was granted.


I've Been Declined for a Mortgage, Now What?
For many, homeownership is an important life goal. Are you searching for a starter home that can grow with you as you raise a family? Or, maybe you're planning on being the only occupant in the new place… whatever your situation, owning your first home is a great financial accomplishment that first time buyers can take pride in. But, as exciting as the prospect of purchasing your first home is, many Canadians are facing one big issue: getting approved for a mortgage.
A Mortgage... it's a reality of homeownership that everyone has to understand, but while many new homeowners are getting mortgage loans from the bank, even more would-be buyers are being turned away.
The first is that you aren't alone. Borrower rejection rates have risen as much as 20% since the new mortgage qualification rules were implemented last year. If you are declined a mortgage loan, the numbers suggest that you're in good company.
The second thing you should know if your mortgage application is denied is that you still have options. You can still achieve your dreams of owning a home.
If your mortgage loan application was declined, fear not – your first move shouldn't be looking for a place to rent. First, you need to find out exactly why you couldn't get a loan. Lenders are usually happy to provide the reason why an applicant was denied, so you should take advantage of this information to determine the best course of action moving forward.
One of the most common reasons why Canadians are denied loans is due to their credit history. If you have a bad credit score, it acts as a warning to lenders that you might not be a good candidate for a mortgage loan. But, what if you don't have a credit card, car loan, or line of credit? How could your credit negatively affect your loan eligibility in that case? For some, their credit score may not be high enough due to the fact that they haven't borrowed and repaid enough money to result in a good rating. Lenders are wary of borrowers with minimal credit history – they'd still be taking a risk that you'd fail to repay your mortgage.
If a lender indicates that your bad credit score is the issue, you should first double-check that your credit report is accurate, and then start working to make it better.
Proof of income can be another reason why borrowers are denied a loan. If you are a business owner, or, if you are self-employed, it can be harder to get approved by major lenders. Many lenders associate unpredictable income with a higher risk of non-payment. Even if this isn't the case with your business, remember that a lender is always looking to protect their investment, regardless of how unique your situation is.
Finally, debt may be a big factor that prevents you from getting approved. When lenders look at your financial health, they examine your debt service ratio. Your Total Debt Service Ratio (TDS) is a calculation of your family's monthly mortgage payments, property taxes, and other debt payments divided by your family's gross monthly income. If a lender finds that monthly mortgage payments would be too great a burden on your TDS, they will likely decline your application. There are a lot of great calculators online that can help you determine your TDS.
These are some of the most common reasons why mortgage applicants are denied, but knowing why your mortgage application was declined is only half the battle. Next, you'll need to find another way to get your mortgage approval.
Once you know why your mortgage application was denied, it may be a good time to take a step back and consider whether the timing is right for you to purchase a home. If you carry a lot of debt or are having trouble paying your bills on time, you might want to focus on paying down your high-interest debt and working out a budget for you and your family before you reapply for a mortgage. Paying off debt and sticking to a budget are two financial practices that everyone can benefit from, whether you're a first-time homeowner, or a retiree!
If you decide that this is still the right time for you to consider buying a home, you'll want to take a look at your loan alternatives. If your application was denied by a major lender (an A-lender), there are other lenders that you can approach with a mortgage application. These subprime lenders (B-lenders) work almost exclusively with buyers that have bad credit scores. A B-lender could be your next best choice if you were declined by an A-lender.
If your mortgage application was denied due to a more serious financial situation such as bankruptcy, you may need to work with a private lender. Private lenders are companies or individuals who loan funds backed by real estate properties. If you do choose to work with a B-lender or a private lender, you may be able to get a mortgage, but your interest rates will be higher than if you were approved with an A-lender.
Another alternative to finding a different lender is saving for a larger down payment. For example, if a lender is approached by an applicant that has good credit, but can only put a 5% down payment on their home, they will likely get a mortgage because they are a low-risk borrower. If the same applicant had a bad credit score, they would need to provide a larger down payment for the lender to even consider their application (say, 20-25%). Having a larger down payment can give you more leverage when shopping for a mortgage. A higher down payment = more equity = a smaller loan = less risk to the lender.
If you were denied a loan by an A-lender, you can consider making your application more attractive by adding a strong cosigner. A cosigner is another person that applies for the mortgage with you. If the person you add as a cosigner has good credit and a stable income, this could be an option that gets you in your new home.
Remember that a cosigner will be responsible for the repayment of the mortgage loan if you are unable to pay. A cosigner adds another layer of security for lenders as there are two borrowers responsible for the monthly payments instead of one.
If you choose to add a cosigner, both of you need to be aware of the risks involved. Your cosigner is just as responsible for monthly loan payments as you are. If you fail to pay your bills, the lender will come after both you AND your cosigner to rectify the non-payment. Failing to make your payments will negatively affect your cosigner's credit score, so be careful and responsible!
Any existing loans will affect your eligibility to carry new loans such as a mortgage. Staying on top of your debts is good practice in general, but doing so can help you get approved. Even if you aren't able to pay off 100% of an existing loan immediately, you should consider shifting your finances in a way that allows you to start paying off your high-interest debt. In doing so, you'll free up more of your monthly income to spend on loan repayment.
Although this one is much easier said than done, earning more money and increasing your income is worth looking into if you want a mortgage. If you are looking at any life changes that might affect your current income (such as moving jobs, or quitting your current job), you should wait until after you are approved. Even then, any time you take a pay cut or experience a change in your income situation, you should have a plan for making your payments and covering your expenses.
As discouraging as it is, there are still options available to you if your mortgage application is declined. With that said, any hopeful homeowner declined for a mortgage should seriously consider whether their current credit situation is something that can easily be remedied, or is a symptom of a larger financial – or lifestyle – issue.
Whether you were denied a mortgage or not, practicing good budgeting, making all your bill payments on time, and saving money when you can are great ways to better your financial health. Taking a proactive approach to bettering your financial situation will not only help you during the mortgage approval process, but also for the rest of your life.


text:
CDC: 'Measles Is an Imminent Threat in Every Region of the World'
Susan Jones | November 29, 2022 | 8:04am EST
A Yemeni child receives treatment for measles Sanaa, Yemen on March 21, 2021. (Photo by MOHAMMED HUWAIS/AFP via Getty Images)
(CNSNews.com) - Measles vaccinations steadily declined during the COVID pandemic, and that leaves 40 million children worldwide "dangerously susceptible" to infection, according to a joint publication by the World Health Organization and the U.S. Centers for Disease Control and Prevention.
The report says 22 countries experienced "large and disruptive" measles outbreaks in 2021, when an estimated 9 million cases caused some 128,000 deaths worldwide.
"Declines in vaccine coverage, weakened measles surveillance, and continued interruptions and delays in immunization activities due to COVID-19, as well as persistent large outbreaks in 2022, mean that measles is an imminent threat in every region of the world," WHO/CDC said.
As of November 17, 2022, a total of 51 measles cases were reported in the United States.
"The record number of children under-immunized and susceptible to measles shows the profound damage immunization systems have sustained during the COVID-19 pandemic," said CDC Director Dr. Rochelle P. Walensky.
"Measles outbreaks illustrate weaknesses in immunization programs, but public health officials can use outbreak response to identify communities at risk, understand causes of under-vaccination, and help deliver locally tailored solutions to ensure vaccinations are available to all."
The WHO/CDC note that measles anywhere is a threat everywhere because the virus is so contagious.
The CDC says that measles can come to the United States from anywhere in the world.
"Outbreaks can happen in areas where people may be unvaccinated or under-vaccinated, including the United States. Right now, measles outbreaks are occurring in every region of the world. Measles can enter the United States through infected travelers entering or traveling through to the U.S. as well as through infected U.S. travelers returning from other countries."
Although measles was declared eliminated in the United States in 2000, almost 1,300 cases of measles were reported in 31 states in the U.S. in 2019— the greatest number since 1992. The 2019 U.S. measles outbreaks were all linked to travel-related cases that reached at-risk populations (un- or under-vaccinated against measles) in the United States.
Since 2016, 10 countries that had previously eliminated measles experienced outbreaks and reestablished transmission.
The top ten countries for current measles cases are:
1. India (9,489 cases)
2. Somalia (8,435)
3. Yemen (6,478)
4. Zimbabwe (5,094)
5. Nigeria (4,551)
6. Liberia (4,085)
7. Pakistan (3,635)
8. Ethiopia (3,060)
9. Afghanistan (1,738)
10. Congo (1,329)


text:
Q: Service worker cached all files, no way to update Last year we put online a website using Gatsby that made use of a service worker (SW) for caching files. A month ago, we put online a complete rework of this website, using a completely different tech stack (ie: not using Gatsby and SW anymore). The new version runs on Webflow now.
My problem is that the previous service worker is still installed on our customers browsers. Any previous visitor is seeing the old version of the website because the old SW cached everything.
I have no way of pushing another JS script to unregister the SW because all the JS files are cached by this same SW! This old version of the website seems to run completely offline now and I don't see a way of removing this old SW and the associated cache (without asking for my customers to manually remove the SW themselves of course).
Does anyone have any idea :D
EDIT with recent observations:
The solution is certainly to provide a new sw.js file.
The easy way would have been to have Webflow (where the new website is hosted) serve a new sw.js file. Unfortunately, it does not seem to be possible (see here).
But I could 301 Redirect to a different location of the sw.js file. Unfortunately (again), browsers don't accept redirect when loading a new service worker.
So I am still stuck there.


Hello, I´m pretty new in this forum and i´m developing a c# program. I´m using Aforge.net for the joystick controls. It runs very well but I have a minor problem with this. When I press a button this triggers several times because i have not found a way to make a debounce on it. Is there some kind of method or any feature to implement a software debounce on the joystick buttons on this library (Aforge.Controls)? Thank you so much.
The current class provided in the framework does not trigger anything. There are no events, callbacks, etc. It just provides current state of buttons. You will need to put some code in your application to achieve your goal.
Thank you Andrew! I really appreciate your answer. I suspected that it was the case as I readed some examples on the web. What i did is to use a timer and test the status of the buttons within each tick so I can program a routine for this "events".