Have you already tried reading
AidenShaw's post?
Simple example 1: if you do a defrag of the virtual disk and nothing more, the performance will either stay the same or go worse, because the disk image is still as fragmented as in the beginning. And if the disk image was a sparse one, surely it will have grown a lot at the end, surely becoming even more fragmented.
Simple example 2: if you do a defrag of the host disk and nothing more, the performance will either stay the same or go worse, because the virtual disk is still as fragmented as in the beginning.
Summary: you need to defrag both disks (virtual and host), and in the correct order, for it to make sense. If you don't, the effect could be all the way from small to much worse. And then you probably will want to zero the extra space in the virtual disk, and maybe even use any internal defrag routine specific for the format of the disk image (VMware had one if I remember correctly, VirtualBox maybe too). And of course, if you use any minimally advanced feature (like snapshots), defragmenting the virtual disk will be terrible: horrible performance, lots of space wasted.
Again, I recommend you to read AidenShaw's post.