Inline function much faster than UDF in C?