Install XCode and try purge.
because my laptop is getting slower
The getting "slower" is new information
You might want to post the above suggested EtreCheck output and allow others to look at what 3rd party kernel extensions, launch daemons, etc... you have running on your system, and maybe they can see something to aid you.
NOTE: if you are running anti-virus software, that is a good source of system slowness. Also utilities that want to "Clean your Mac" or "Look for malware". They tend to consume RAM and CPU cycles.
It could also be that you are just asking your Mac to do more work today then you did in the past, and you are staring to exceed the hardware as currently configured (translation, maybe you need more RAM or a faster disk to do the kind of work you are doing now). Again EtreCheck output would help in that analysis along with a description from you of what kind of work you are doing.