What is shading resolution for?

I often wondered why shaders and effects ask for resolution, which i always assumed i have to fill in canvas size, but i noticed when going through the threejs examples sometimes see fixed values, sometimes canvas size, sometimes 1 / canvassize. Could somebody explain?

I also don’t see any difference in quality between canvas size and fixed, other than size. In this example for instance https://codesandbox.io/s/react-three-fiber-line2-wireframe-iup24 512/512 make the lines a little wider, but when i adjust the lineWidth i see no difference to full canvas resolution. But can i assume that smaller, fixed values are faster?

The resolution value is normally used to consistently sample a texel’s neighborhood in the fragment shader. A good example is the implementation of SobelOperatorShader:

vec2 texel = vec2( 1.0 / resolution.x, 1.0 / resolution.y );

float tx0y0 = texture2D( tDiffuse, vUv + texel * vec2( -1, -1 ) ).r;
float tx0y1 = texture2D( tDiffuse, vUv + texel * vec2( -1,  0 ) ).r;
float tx0y2 = texture2D( tDiffuse, vUv + texel * vec2( -1,  1 ) ).r;
// more samplings

and if the resolution is smaller, will it have any impact on performance or that completely unrelated?

Well, lower resolutions in general speed up the performance in the fragment shader. But the above code will not be executed faster for a single fragment if resolution is smaller.