Requests are slow while inserting external data via cronjob

Maybe this thread will help you: https://forum.strapi.io/t/what-is-the-best-way-to-bulk-update-entries
To run custom code from frontend: You can create custom code in the ./controller/ directory of an endpoint.

Edit: changed link