How do you determine speed of a sailboat before you buy it? When I say speed of a sailboat I mean in comparison to wind speed.
Wow! What a far-reaching question! But, let me start off the discussion, and there'll be more contributions from others.
Generally, sailboats have displacement hulls, and their speed capabilities are traditionally thought to be limited by their waterline length, but that's not exactly true. Sailboats can, and often do, exceed their theoretical hull speed, especially when sailing off the wind. Therefore, you can get a very limited idea of a boat's speed capability by determining its hull speed, which can be calculated by using the following formula: Hull Speed = 1.34 x the square root of the LWL (length of the waterline)
However, the length of the waterline doesn't tell the whole story. Some sailboats with a waterline of a certain length will be faster than other sailboats with the same waterline length, due to other design variables, such as the beam (width) of the boat, and the shape of the keel or rudder, the amount of sail area, and the displacement (weight) of the boat, among other things.
The differences in the design features of a sailboat can cause one boat to exert much more drag than another boat as it moves through the water, reducing it's speed. Design differences can also enable one boat to plane more easily than another boat, which greatly reduces the amount of drag and increases speed.
What can you do to enhance the performance of a sailboat?
The "performance" of a sailboat includes not only it's speed capability, but also it's ability to sail close to the wind, among other things. I assume your question refers to speed.
Generally, you can enhance a boat's speed by maximizing the ability of it's sails to generate driving force, and by minimizing drag. You should use the biggest sails that the boat can carry efficiently, and trim them well. You can reduce drag by placing the crew's weight in a position that will usually keep the boat as upright as possible, and will result in the least amount of wetted surface. There are a gazillion other factors that often take a lifetime to learn, but I'll let others try to think of them all.
You might ask, why would anyone use design elements in a boat that don't maximize it's speed? The reason is because speed isn't the only quality that people find desirable in a sailboat. Sailboat's are designed for a particular purpose. Some are designed for all-out speed and pointing ability, and some are designed for safe, reasonably fast and comfortable cruising. People buy the boat that best meets their needs.