Yes, physical and redstone mechanisms always cause at least a bit of lag. The best you can do (if you don't want to overanalyse everything) is to avoid redstone dust as much as possible. When redstone dust turns off, especially long lines, it causes much lag.
Item frames also cause more lag than you might expect.
Light updates are also pretty laggy, so you should better build a ceiling above your contraptions, if you have moving parts. But be careful about mob spawning.
Entities are also a source of lag, especially if they are near each other. Try to make the area spawn-proof and don't keep animals near laggy areas.
The game is only loaded up to a certain distance from you, so if you don't need something to run all the time, build it far away, then it'll pause when you're not there and not cause any lag.
If you have no problem with modding, there is a mod called "Optifine" that optimises performance, but mainly client-side, meaning that your framerate gets better, but the server (what's handling redstone etc.) is mostly unchanged.
In general, any PC can only handle a certain amount of stuff at the same time. So if you get lag, you can try to optimise against it and if that doesn't help, you'll either have to live with the lag or get a better PC.