As root: (as a regular user it just won’t work) –
btrfs filesystem defragment /home -r
You probably want to run that weekly.
I eventually noticed Thunderbird and phpStorm were being really slow and laggy … at which point I realised the cron job I had (as my non-root user) wasn’t working.
filefrag /path/to/file you can see the change in the number of extents change after defragmenting)