It's my understanding that British shipping was significantly harried by German submarines during WWI. With this in mind, it seems logical that the British would attempt to close this gap, either through advancements in technology or doctrine. However, it seems as though they were utterly unprepared for WWII and again were losing tons of merchant ships to submarines. Has the impact of submarines on British shipping been overblown? Were there significant advancements on the British side but they merely lost the arms race? Or were they simply stagnant and unprepared for another global war?