The 'perfect solo' is something most guitarists strive for, however there is no absolute formula. Most guitarist think that SPEED IS ALL but that is not necessarily true. Its is important to have some good licks, themes variation and lots of other techniques:
Every good solo should have a recurring theme(s) so that people can remember it because you want people to remember it and buy your CD or talk about you wherever they go. If you just shred no-one will be able to hum it and thats what you want people to do minutes, hours, days, weeks, months and even years after you play it to them. Give it a melody, steal part of the main melody in your song, like in AX7's Afterlife. Its your chance to show off but it still needs to fit into the song.
In all solo's there should be some musical direction, it should be a journey from, for example, a happy place to a sad place. This would be achieved by finishing one run with a tonic note (The note of the key, I), and then finishing the next run with relative minor note (vi). This can be done many times in a solo and you don't HAVE to finish on these notes.
Some notes do not allays have to be picked, by using hammer-ons/pull-offs (Legato) the same notes can be played but have a looser feel to them. These can also be used to make your playing seem faster and give them a different sound. Staccato on the other hand is when you pick the not and stop it very quickly, this can be very effective to make the a part of your solo snappy.
Used as a way to play very fast, this does have a place in your solo but this should not be the bread and butter. If you do use this and you can get blisteringly fast you should even be able to use passing chromaticisms that add a whole new dimension to your playing.
Some solos can be built round a bend while others have bends at the end of the run to add some ornamentation but you have to make sure you reach the harmony note otherwise it may sound out of tune
Guitarist like John Petrucci use these a lot, this is when you play the same note (Usually the tonic again, I) then and then alternate between other harmony notes, for example, C-E-C-D-C-B-C-F-C.
These are only a very few techniques (writing them all could fill a book and they have filled many books!) that you can use in your solos so get out there and explore them all, the more you use the more advanced your solos will become and the more faces you will melt! Also don't be afraid to try something new, cross cultural-cross generational, there are endless possibilities and a little research could serve you well. PM