Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
How we optimised our software loading time by 5x?
Prashant Basnet
Jul 19, 2024
152 views
How we optimised our software loading time by 5x?
Unisala was initially written in ionic react. The reason? Ionic is one stop cross platform development framework. You can develop
all from one single code base. It sounded so good, why would anyone just pick ionic to build there app?
I have developed couple of application on ionic before unisala. I created e-commerce app on it before this. I never got to deploy it to real time user thus I was not exposed to the limitation of ionic app.
Discovery Phase:
We then started seeing the downside of the framework. We'd share university link or our thread page to the user and they'd come back saying hey the site is down. This was a common issue to us.
We moved on, cause we can see the site was up and running from our side.
This pattern often repeated when we send links of site to new user. As the complain increases we decided to do something, we started paying attention app's performance and user experience especially our build size, app loading times and compared it
For Returning User:
Since the browser download the app size on the first fetch, for returning user it was not taking significant time to load the app.New users experienced long loading times
New user:
Initially, our app first build size was 6mb. We found out that to download the app for the first time user it was taking 2 mins on normal 3g internet which is our phone network.
We discovered then we optimised trying to reduce the the size, we were able to reduce it to 3mb, with simple efforts. Just trimming heavier packages out of the app. But it was still taking 1 min to download i.e 3mb app size.
When app takes more time to load, the drop rate increases, no way a user would wait 1 mins to try a new product. An ecommerce site like amazon would loose millions of dollar every second the site takes longer to load.
We then tried our best to trim all the heavier package out of the product. The best we could optimize app size was to 2.2 mb. At this point we were even discussion whether to include ionic-icons package or not, this alone was 700kb.
As we wanted our site to load in less than 5 seconds for 3g .e phone network, This clearly was not our solution.
Then we started looking for other solutions:
How can we reduce our bundle size so it loads faster?
So then second question, chime in.
How should the landing page be added?
1. Static Page:
Initially we experimented with just one single static page with html ,css , js.
we could just go to one of these sites like: colorlib
A nice site was around more than an 1 mb, which is not what we wanted.
2mb took around 40 seconds to 1 min, 1 mb would still take more than 20 sec.
2. Microfrontend:
This was something new to me as a developer,. I have worked with micro services before but on the backend, i never created/worked on project where frontend had micro service.
We started experimenting with different library and framework our top choices was Next.js.
So we experimented with both next js and astro,
What this means: Astro helps make websites that are faster and work better for users than most other popular tools.
we decided to stick with Astro.
3 The result:
a. Faster loading times 5X:
i. Ionic app takes about 23 seconds for new user to see the thread
ii. Astro loads in around 4seconds
So , we see almost 5X improvement in speed.
b. Seo performance 90+ score:
c. All web-vitals reported by google light house has gone up.
i. Ionic web-vitals reported by lighthouse:
ii. Astro web-vitals:
d. Clean Readability:
ionic app has nav-bar, search-bar, and other mobile app looking feel, which is more cluttered while reading a single article.While astro is more clean
Conclusion:
Key Takeaways for developers:
if you think this is helpful, let me know by upvoting or commenting.