What is cheaper on the memory, Raycast or getting 2 actor locations?

I am working on a little melee fighting game.
I have a function where my AI is trying to figure out how far the player is.
The player can run around in any direction, he can also ascend or descend stairs.
I wasn’t even sure how to raycast, in every single direction.

I am doing it by getting the two locations and subtracting them as shown below.
(at least that is the start of it, there is a bunch of ‘rube goldberg’ nodes after that
to check different directions, and deal with unsigned and signed numbers)

The brute force function gets the job done, but I want to know if this is the best
approach to the problem.

Is a raycast more efficient in this situation, and if so how do I set that up?

A typical ‘rube goldberg’ solution
c2179fe2ab90f5fa1127cc6928548192cead78fa.jpeg

my solution
cub_simp_machines_lesson05_figure2.jpg

You have this https://docs.unrealengine.com/latest/INT/BlueprintAPI/Utilities/Transformation/GetDistanceTo/index.html
and this one can be handy https://answers.unrealengine.com/questions/11053/getting-distance-between-two-vectors-in-blueprint.html

Things like getting a location are extremely efficient, and you shouldn’t be running into any issues.