3 minutes definitely seems excessive but it depends on how you've executed each of the steps you mentioned. How many total calls is your app making to the API over these three minutes? One thing that stands out for me are steps (2) and (3) - are you parsing the ShopifyAPI::Variants.find(:all) call locally or grabbing the IDs and making an individual request for each of the 50 variants? Additionally, on step (4) is the find called for each variant?
Interacting with APIs is much like interacting with a local database - you want to minimize your reading and writing. Each action will take less than a second but at scale it can add substantial latency. Depending on how you have things setup looking at things through that lens might help out.