The performance is the same ?.
No it isn't because a L3 switch routes packets in hardware and a router routes packet in software so with a L3 switch and a router costing roughly the same the L3 switch will vastly outperform the router.
The two technologies grew together. The router however tends to offer more WAN interface solutions (WIC) than the L3 switch. There is also the advantage of the logical abstraction that the router provides over the L3 switch.