Shorter water line and less displacement means less drag.
That's what one might think - but in fact hydrodynamics work differently, reducing relative "drag" (not through friction, but through wave formation) when waterline length increases. That an increase in what one might more properly call drag (skin friction) also takes place when there's more steel against water is not quite as significant - wave formation concerns already dictate a maximum "hull speed" beyond which either trickery or lots of brute force is needed.
For sailing ships, neither trickery like planing nor brute force ever was an option, giving long ships a decisive advantage over short ones. For machine propulsion, hull speed is something you can circumvent: speedboats do it by planing, but destroyers use brute force, having
lots more of it per displacement (or per waterline meters) than big carriers, battleships or tanker or container behemoths do. And then you can have unconventional hull forms that directly affect wave formation - but no warships of note utilize those today, although some so far less than satisfactory USN experiments are ongoing.
Whether tinkering with waterline also affects your displacement is a separate issue altogether. And an increase in displacement may well increase the absolute effort your machinery has to make (but not through drag as such). The thing here is, the
relative considerations
together favor big hulls over small ones: to increase the speed of your WWII battleship, you'd much rather insert a few extra meters of length than increase your output power. That's why the Royal Navy, a bastion of silly tradition if there ever was one, finally opted for "transom" or truncated sterns for their battleships, essentially extending the sides of the ship maximally far for given displacement rather than hanging any of that displacement (read: displacement-creating mass) uselessly above the water. Steel underwater simply gave better performance than steel in the air.
Of course, many other factors also favor big over small when it comes to those warships or transports that end up being big in the real world: a small carrier or a small battleship fights poorly, and a small container ship, tanker or car carrier brings in less money. Things get muddier when a navy actually wants to keep some of its ships small, despite this costing them dearly in terms of speed (read: ease at which speed is achieved). But all modern destroyers are well past the threshold size for 30-knot
dash performance (even when hull speed would keep them
cruising at more like 15 knots - you need to go nuclear to dash all the time!), and few navies have any interest in anything substantially faster than that. (OTOH, few navies have any interest in fast frigates or corvettes, there surprisingly being minimal effort to circumvent the hull speed limitation in that category of ships.)
And here is where I said you have to define small. At some point a vessels is so small you can't fit the power in it and have it remain viable. A dingy is slower than a carrier. But a craft boat is faster than both (at ~20 feet).
We know the real-world rules by which these three types of seafarer are governed (different rules for all three, really). The interesting thing is, what sort of rules govern warp flight? Or impulse flight, assuming it's not a simple Newtonian business?
On the seas, big is not the only requirement for fast. But big is the most important requirement for fast when you aspire to be big to begin with - only small craft have other options to choose from. It's an intriguingly counterintuitive situation, and something similar might be at play in Trek, too.
Or then not, but so far big starships have always been faster than small ones, and no small craft have been able to match speeds with bigger ones from the same cultural context ("advanced small" against "primitive large" is a different issue) without resorting to things that amaze our heroes: suicidal power allocation, say.
Timo Saloniemi