Python Data Function Performance

Hi Spotfire Team,

I have written python code which accepts input, runs model and generate results, all this activity is getting completed in hardly 0.0070 to 0.0090 seconds[Time calculated in Python Jupyter Notebook], however the same code when I am running from Spotfire Python Data Function is taking time like around 3 to 4 seconds.

How do I make sure it runs faster or in same intervals as in Python Jupyter Notebook ?