I'm not even sure how to ask this question properly, but let me try.

I'm on Mojave 10.14.

I found a directory in my trash can that is extremely slow to delete. When I try to go into the directory, finder shows spinning at the bottom and does not displays the files in it. I've waited well over 10 mins.

When I try to use "ls" cmd in the terminal, it also takes over 10 mins and does not display anything.

When I try to empty the trash, it is EXTREMLY slow. The # of files deleted increases 1 per second (almost). I've waited well over 30 mins and it was still not finished.

How do I diagnose this problem and find a solution?

Update 1: Filesystem is APFS and the directory has more than  12,000,000 small json files.