While surfing stack exchange, I have seen many people mentioning speed efficiency in their answers. How is one code faster than the other one which does the same function? 

What makes the code run faster? Less lines? 
Does importing mean loss of performance?
What things should I keep in mind to write performance efficient code?
Why do I need a performance efficient code?

I have also seen people writing 

Loose on speed to gain on beauty? 

Why are beautiful codes slow?
Picking a better algorithm can often lead to remarkable speed improvements.
For example, replacing bubble sort with quicksort; same job, better algorithm, much faster.
The faster algorithm may be harder to understand, and there are other costs in time to write and maintain the code; but I have seen a job which took 4 days to run reduced to 25 seconds by a better algorithm.
For more detail, search on "Big O Notation" - a way of describing the asymptotic performance of algorithms.
Write speed efficient code in python