Difference between calling a service method in drupal 8 I want to know what difference does it make when i call a service this way : 

$service = \Drupal::service('myservice.method');
$service-&gt;methodNameInService();


or this way (Dependency Injecton)

 public function __construct(MyService $myService) {
+    $this-&gt;myService = $myService;
   }

public function test() {
    // Call function from service 
    $this-&gt;myService-&gt;methodNameInService();

}


Is this better for performance or is it just only the right way and has it zero effect on performance or something else?
Dependency Injection has several advantages when you try to create test for your code, and follow the Single Responsibility Principle. 

Really, the second reason is a consequence than the first: "The code is testeable because follow the SRP"

Furthermore, IDEs can recognize better the class type (and create autocompletes, f.e.) if the class is defined using DI. In a normal IDE, $service defined in $service = \Drupal::service('myservice.method'); has a unknown class.

In some places you cannot use DI (fe. in a .module) and you need to use the static load.