Copy module

I'm using ansible to build a package in Jenkins and the make an rpm.
The copy function takes 20+ minutes to copy a few files. Using the command function takes under a second.
The synchronize function is generally unusable (better off using rsync from command)

I was wondering what other people's experiences are with copy and synchronize.

After further investigation it appears there are a lot of serious short comings using ansible directly to build an rpm.
It looks like it's not a fault with ansible per say, just how I'm trying to (ab)use it.
The thought occurs about writing an ansible module to make rpms.
Would there be wider interest in this?

I have had great success with the synchronize module as of Ansible 2.4.

In my opinion, your use case sounds like reasoning to create a custom module.

My copy speeds greatly increased when I moved the package source to the same datacenter as the target resources. Could it be a location issue where your network speed gets throttled?

It's not a network issue. Local and remote are localhost.
The speed issues seem to be down to abuse of ansible.
Just to process the files dictionary list into a sensible format took over three hours (I gave up) and used 12Gb of ram.
Using a shell script takes less than a second.
Ansible is doing a lot of checks, that in this instance are pointless.
There is a lot of manipulation of data as well, that would be far easier in python too.
So a module to make an rpm I think is the way to go.