I was transferring around 12k images (total size around 2 GBs) from my laptop to my Android phone via USB. Initially, it was around 5-6 images copying per second and soon after around 500 images speed began to drop and reached more than 5 seconds per image. I tried copying them in batches of 500 images but that was no better. It was like the more the number of files in a directory the slower it is to add more to it.
Then what I did is make separate folders in the same directory and copy only about 500 images at a time to each. This way I got speeds of 5-6 images per second similar to what I was getting initially when I was transferring them all at once to a single directory. Later, I simply moved the images out of those folders using native file manager in my phone, which was almost instantaneous.
Why is that speed was decreasing exponentially when I was copying all files to the same directory?