This paper follows the basic principles of taxi dynamics and uses an agent-based modelling approach (ABM) to simulate the underlying road network, vehicles and passenger situations in an urban environment and to carry out evaluations. First, based on two evaluation metrics: passenger travel time and total number of passengers transported, a comparison is made between the ride-hailing system (RH) and the system with ridesharing under different supply and demand rates, revealing the impact of ridesharing on system efficiency at urban scale. Then, in the ridesharing system (RS), four levels of supply are taken as examples, and passenger travel time is disaggregated to quantify how the definition of vicinity in the matching process affects the passenger travel time, passenger waiting time and vehicle detour time in a given city. Finally, a summary of the level of supply and the range of vicinity where ridesharing can be effective is presented in terms of the total distance travelled by the system. From a city management perspective, these results can help in the analysis and planning of efficient transport services.