What the difference between onValueChange.AddListener, GetComponents<Inputfield>().text and InputField.text?

I stumbled upon this 3-solution code that displaying the output of Input Field in a text real time, and my question is there a difference between these 3 functions?
I know it has the same output from what I am trying to do, but I think I need to decide which is the best for clean code, has great performance advantage and for the best practice or it doesn’t matter at all? Thanks for answering.

onValueChange.AddListener

using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;
public class InputFunction : MonoBehaviour
{
    public InputField InputSearch;
    public Text txtOutput;


    private void Start()
    {
        InputSearch.onValueChanged.AddListener(OnSearchInputValueChanged);
    }

    private void OnSearchInputValueChanged(string searchValue)
    {
        int valueLength = searchValue.Length;
        txtOutput.text = searchValue;
        Search(searchValue);
    }

    

    private void Search(string searchTerm)
    {
        Debug.Log("Performing search with term: " + searchTerm);
    }


}

GetComponents<Inputfield>().text

using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;
using Unity.VisualScripting;
public class InputFunction : MonoBehaviour
{
    public GameObject InputSearch;
    public Text txtOutput;

    public void getAllTxt() {
        string valueSearch = InputSearch.GetComponent<InputField>().text;
        txtOutput.text = valueSearch;
        Search(valueSearch);
    }

    

    private void Search(string searchTerm)
    {
        Debug.Log("Performing search with term: " + searchTerm);
    }

}

InputField.text

using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;
public class InputFunction : MonoBehaviour
{
    public InputField InputSearch;
    public Text txtOutput;



    public void InputFieldValue() {
        string valueSearch = InputSearch.text;
        txtOutput.text = valueSearch;
        Search(valueSearch);
    }

    

    private void Search(string searchTerm)
    {
        Debug.Log("Performing search with term: " + searchTerm);
    }


}