One post you may want to look at is by user "p.H" http://forums.debian.net/viewtopic.php?p=706232#p706232 (20 August 2019) who said
I have heard both ways, that swap files are just as good as dedicated partitions, and that users have good results with a swap file vice partition.Do think twice before doing that. Linux was designed to use raw block devices as swap space, and still is. Using swapfiles with Linux is a hack. A dirty one. It does not work natively on filesystems types which do not allow to map files to physical blocks, use copy-on-write, and so on ; making it work natively on some of them (NFS, Btrfs) has required heavy intrusive kernel patching. The only clean way to use a swap file would be through a loop device, which incurs a performance penalty.
I prefer a dedicated swap partition - just another point of view.