Is it normal python is very slow compared to JS?

Hi everyone,
i wonder if it is normal python script is slow compared to JS script for the generation of a html graphics

I try to plot five DateTime series of 14400 points (10 days)

If i use the JS script with php: my page loads in <1.3s (whose 60 ms for the sql requests. I don’t know how to trace the time execution of JS script only)
Edit, i use

var t0 =
Plotly.newPlot('chart', data, layout);
var t1 =
console.log("Call to doSomething took " + (t1 - t0) + " milliseconds.")

And the execution time in JS seems to be 500 ms
If i use the python script to create a html figure, the time execution to produce the graphic (between “fig = go.Figure()” and “fig.write_html” take 3.2 s.

fig.write_html take less than 1s (size of the final html is 1.5Mo)

=> Is it normal the five “add_trace” command takes about 2.2s (3.2-1s)?

Any way to speed up the python script execution time?

Python is required because i would use pandas librairy to resample et compute some dedicated functions performed on the original data and i can’t do this in php

Thank you