Boost Performance DEF Sync Call

The feeling you get something live on which you poured hours and hours of work and sweat, priceless! But, what if you are not happy completely? Something is curbing the feeling of being happy a notch or so down? This is exactly what happened to me when I pushed the whole deal of using Tenant Service live. You can read more about how we used Tenant service on my previous blog here

It was just such a relief! Launch was super smooth, I honestly did not expect it to be. Was prepared to be a warrior to fight with any issues that would come by way. But, I was a lucky warrior who simply had to pose with the armor on and no real fight lol

Performance of the form submission after adding ‘Trigger DEF Sync Pipeline’ was bitter. It was taking on average around 8 – 11 seconds for form submission to be successful. Upon more research, turns out custom form submit actions are synchronous, they run one after the other before friendly thank you page or note is shown to end user.

Other way I could think of is to make the most expensive pipeline step Asynchronous. It was easy to point the culprit in my case, it was the step responsible to submit the form submission information to Salesforce that was adding all the time for processing. I logged in a ticket with Sitecore to understand how exactly I can transform a pipeline step to be asynchronous. They suggested that I do something like below:

Make a custom pipeline processor inheriting the OOTB processor for the step of concern

And then, on the pipeline step of concern, point to the custom processor instead of OOTB one. Something like below:

Swap processor type to custom one created on the solution

I was not confident it would work, but, tried my luck and performance was much better afterward. It was averaging between 3 to 6 seconds and later submissions were even quicker. This is a huge improvement from where things were, so, I am one completely happy person after pushing this fix live. 🙂

Do note that for this pipeline to fire, on first pipeline step based on template below, ensure the Minimum batch size is set higher than the current scenario. In our case, the queue size will be ‘1’ always because we are firing the pipeline on single submission. In my case, as screenshot shows below, I set that to ‘2’. Only then our custom processor will run, if you are curious decompile the code to see why I said this.


/sitecore/templates/Data Exchange/Providers/Salesforce/Pipeline Steps/Create Object Queue Pipeline Step
Showing minimum batch size recommended for form submission use case. Value dependent on your scenario.

Now, I can relax and enjoy the successful launch! Also, I can recommend Tenant Service and CRM Connector with more confidence to scenarios that need them.