$user_id vs. is_user_logged_in()

Well it wouldn’t always work unless you global $user_id. is_user_logged_in will however work without that extra line of code. The speed improvement is most likely so small it’s less than the speed improvement between single and double quotes and not even worth thinking about.

Also $user_id variable may disappear in a new version and would promptly break your code, were as is_user_logged_in will be about for ages even if they decide to deprecate it.