Right way to call heave tasks.

Right way to call heave tasks.

Hi All,

I have a jquery mobile hybrid project where I call native functions from javascript using native bridge. These function calls are pretty heavy. if 1 javascript line of code takes .1 ms, the native function call is 2 ms. I cannot avoid these calls because entire business logic is residing here. Currently i call it from pageshow / pagebeforeshow. The result is the page draw and rendering is hold up for a few milliseconds and hence i see a flash, which looks ugly. 

what is the right way to do this ?

should i call these functions from setTimeout inside pageshow ?