In local server it tooks less than second. but in production it took more than 5 seconds.
I tried to find where is bottleneck and checked function execution time.
Longest time I measured was 1 second from Analytics.load_clicks(bitly) (this function does external api request)
I added IO.puts function before and after poke. and it took more than 5 seconds to print “poking is done”
I think “poke” is the one cause the problem.
Am I correct?
I deployed in Heroku and using Hobby dynos
What is your latency to your heroku server? Like just access a path that doesn’t exist on it and how long does it take to respond 404 from that request?
EDIT: For note, Drab works over Phoenix Channels, it would absolutely not be slow, either the work being done is slow or the network connection is slow.
OMG. 2 seconds on DEV? It is definitely not a problem with latency, but with the complexity of your page! Either you page renders for 2 seconds, or you have a plenty of big assigns on the page.
I suggest two solutions for this:
cut your page into pieces by using partials - here you can see the advantage of this approach
do not use Drab.Live, as it must re-render the page at every poke you do; use Drab.Element to update the page instead
Oh wait that’s from the server to the client with response back to server (not client to server with response back to client)? That is crazy slow then, I’ve never seen that be slow in dev! (I use a lot of shared commanders though)
I was using Drab in production on Google Cloud Platform. Everything was lightning quick. Switched to Heroku and now there’s a noticeable delay in all Drab actions. (but I can’t comment on things taking 2 or more seconds in dev though)