We actually don't know the range of either missile. Stuff one reads online is not supported by a clear and trustworthy source. It could be YJ18 range is over 220 km. (Klub is officially advertised with such range) It could also be YJ12 range is 500 km. Certainly, 400+ km range for YJ12 would be very logical and to be expected, even at the cost of a small warhead - as then every launch platform (H6) could self designate the target at said distance.
We don't know if there are changes from Klub to YJ18. Klub antiship missile is officially advertised with 20 km of supersonic dash. That's a bit low for today's threats. But YJ18 may have very well increased that. Still, we don't know.
Having a missile cruise its way over 400 km at more or less constant mach 3 is certainly beneficial (terminal speed in low altitude attack profile, which i believe is more proudent, is likely to be somewhat less, given the low altitude and thick atmosphere. Maybe similar to KH-31's mach 2.5?) The target has less time to react and defend/escape. There's less time to actively threaten the targeting platforms. And given that the flight time over said 400 km example is likely some 8 minutes, there's actually very little the defender can do even by removing the targeting platforms as the missile will most likely still find the target after those 8 minutes - the ship is unlikely to be able to move that much away in those 8 minutes. (maybe 6 or so km) Of course, final radar lock when flying low is likely going to be at some 30 km away from the target ship. So actual time elapsed to that point will be less, some 7.5 minutes to get to the 30 km mark.
Lets assume the same range for YJ18 - 400 km. And lets assume 30 km distance from the ship for the final target check, when the missile keeps a radar lock onto the ship the whole time and flies supersonically. supersonic dash stage is for Klub advertised at 700 m/s. That's just north of mach 2.
Cruise flight speed for Klub is advertised between 180 and 240 m/s. That sounds to me like it's dependent on fuel consumption or missile mass, as fuel is being spent. So I'll just use 210 m/s. That's basically mach 0.64. That's 28 minutes to get to the 30 km mark. That's also quite okay, I'd say. The ship may be some 20-ish km away from its original position but the missiles may be doing a periodic update even from a 100 km away. (this is guesswork, there's no public info on whether missiles are programmed to do that)
But if the targeting platform is engaged after firing either destroyed or simply chased away - and if no more targeting updates are given to the missiles while they're still half way to the target, at some 200 km - then the missiles may not get any more updates until they lock onto something on their own. Which opens to the door to jamming, decoys, various deceptions or even, theoretically, forces the missiles to do last minute turns to change their trajectory, and if that's done at the end of the potential range - the missile could miss altogether.
All in all, I would label YJ-12 to be somewhat more potent platform of the two. But at the same time, it's a bigger missile, double the weight, so it's simply not practical to be carried/used in similar numbers per launch platforms.
We don't know if there are changes from Klub to YJ18. Klub antiship missile is officially advertised with 20 km of supersonic dash. That's a bit low for today's threats. But YJ18 may have very well increased that. Still, we don't know.
Having a missile cruise its way over 400 km at more or less constant mach 3 is certainly beneficial (terminal speed in low altitude attack profile, which i believe is more proudent, is likely to be somewhat less, given the low altitude and thick atmosphere. Maybe similar to KH-31's mach 2.5?) The target has less time to react and defend/escape. There's less time to actively threaten the targeting platforms. And given that the flight time over said 400 km example is likely some 8 minutes, there's actually very little the defender can do even by removing the targeting platforms as the missile will most likely still find the target after those 8 minutes - the ship is unlikely to be able to move that much away in those 8 minutes. (maybe 6 or so km) Of course, final radar lock when flying low is likely going to be at some 30 km away from the target ship. So actual time elapsed to that point will be less, some 7.5 minutes to get to the 30 km mark.
Lets assume the same range for YJ18 - 400 km. And lets assume 30 km distance from the ship for the final target check, when the missile keeps a radar lock onto the ship the whole time and flies supersonically. supersonic dash stage is for Klub advertised at 700 m/s. That's just north of mach 2.
Cruise flight speed for Klub is advertised between 180 and 240 m/s. That sounds to me like it's dependent on fuel consumption or missile mass, as fuel is being spent. So I'll just use 210 m/s. That's basically mach 0.64. That's 28 minutes to get to the 30 km mark. That's also quite okay, I'd say. The ship may be some 20-ish km away from its original position but the missiles may be doing a periodic update even from a 100 km away. (this is guesswork, there's no public info on whether missiles are programmed to do that)
But if the targeting platform is engaged after firing either destroyed or simply chased away - and if no more targeting updates are given to the missiles while they're still half way to the target, at some 200 km - then the missiles may not get any more updates until they lock onto something on their own. Which opens to the door to jamming, decoys, various deceptions or even, theoretically, forces the missiles to do last minute turns to change their trajectory, and if that's done at the end of the potential range - the missile could miss altogether.
All in all, I would label YJ-12 to be somewhat more potent platform of the two. But at the same time, it's a bigger missile, double the weight, so it's simply not practical to be carried/used in similar numbers per launch platforms.