On Thu, Mar 24, 2011 at 12:51 PM, Rodrigo Kumpera <kump...@gmail.com> wrote:
> Now onto the null check. Such a null check will exploit a cpu feature known
> as branch prediction, which guesses the outcome of the
> conditional jump. Since in the majority of the cases the value won't be
> null, the cpu can pretend the branch doesn't exist and keep executing
> as it was not taken. This means the null check costs virtually nothing on a
> modern cpu.

Could we have the JIT recognize the "if (foo == null) throw ..."
pattern and add a branch hint?

-- 
Michael Hutchinson
http://mjhutchinson.com
_______________________________________________
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list

Reply via email to