Flying is the fastest option (1h10), but you'll have to take into account:
- traveling times to the airports: London City Airport is close to the city center (22 min to Bank Station), but Edinburgh Airport is not (35 min by the tram or 30 min by the slightly faster Airport 100 bus, or 25 min in light traffic if you're driving or taking a cab outside peak hours) – add also some waiting and walking time;
- time spent getting through security;
- time waiting in the boarding room or for check-in (15 to 30 min at least, depending on whether you have luggage or not).
So this will probably bring you closer to 3 hours total, city center to city center. Flying though London Heathrow will take even more time (to get there: 15 min train from Paddington station every 15 min, and because the minimum conformance times are higher). And even worse for Stansted: the Stansted Express, the fastest route available between Stansted Airport and Central London, takes 47 minutes from Liverpool Street.
London Gatwick and London Luton also offer a few flights to Edinburgh but have longer conformance times and are way further from the city (so there's no point flying from them if you're inside London, the train is faster). See here for the full list of airlines and destinations served from Edinburgh Airport.
By train, the fastest is with the East Coast Main Line: 4h20, running every hour from 7am to 7pm from King's Cross (some additional trains take ~5 hours). But there is also a sleeper service from London to Edinburgh (the Caledonian Sleeper Lowland Route), which can be interesting to gain time:
Travelling southbound, the Caledonian Sleeper departs from both Edinburgh Waverley and Glasgow Central at 23.40. On a Sunday the service leave a little earlier at 23.15. The Glasgow Central train stops at Motherwell with both trains then joining at Carstairs. The train crosses the border stopping at Carlisle and then at Watford Junction before arriving at London Euston by 07.10, plenty of time for breakfast before having a whole day in London. Travelling northbound the Caledonian Sleeper Lowland route sets off at 23.50 five nights a week and at 23.27 on Sundays. The train splits into two portions at Carstairs with arrivals to Glasgow Central at 07.20 and Edinburgh Waverley at 07.20.
On the East Coast Main Line, you can book up to 5 months in advance (excluding weekends and bank holidays, which can only be booked 3 months in advance).
Driving is not a fast option (over 7 hours), but an overnight bus can also be an efficient and cheap alternative worth considering: the Megabus Gold which costs around £50, roughly 23:00 to 07:15 the next morning.
You might also want to know that flying (especially from London City Airport with views over London) and taking the train during the day (with preferably a seat on the right-hand side for the part between Newcastle and Edinburgh) are the most scenic.