[Steemia] - Performance & UI

in #utopian-io6 years ago (edited)

After few testing on the application I noticed something making the app slower. Angular was trying to track each single change that can occur in the app where most of our data are static. This was dropping all the FPS trying to track those changes.

Changes Made


  • One of the most important changes that I did was to run the functions in charge of populating posts to the respective UI. I decide to call these functions outside the Angular changes detection context just because this data is not intended to change constantly. So, a constantly detection of changes is not needed for this kind of data.

  • The most second important change was to implement the pagination correctly. Before, we were just increasing the limit and calling the whole array each again (worst decision). By doing this, Angular will have to recalculate and redraw all the post even if the user does not notice it. Now, we are using offsets to retrieve the next chunk of posts.

  • Also, instead of re assigning the array of posts, we are now pushing data into the array so older already painted post will not be affected.

  • Images were also a big issue in this app. We use to call images directly from the URL because we didn't know that we can call images already resized from one endpoint of Steemit. By doing this, we can get a fix size of images and a reduced size of them giving the user a better experience.

  • In addition to images, images are now cached for 7 days with a concurrency of 10 images at the time to avoid overloading. In addition, the cache limit is set up to 20 MB (we are still thinking to reduce it to 10mb or 5mb). And images load in a different thread outside the UI thread.

  • The old http module was replaced by the new httpClient. So now we do not need to convert the response to json since it is already done by default.

  • Update the old dependences in the project.

  • Remove lazyload from the tabs page and the sections in the tab itself to improve the load time of these pages since they are loaded first.

  • Change main templates from html to a single string to avoid http calls of these files.

  • Split the post renderer component into two to reduce the size of the files and have an easier escalation. Now, there is a component called post-card which can be editable and reused in any place of the app.

  • Create a single scss shared file to be used in all tab's sections

  • Add some styles to the design and start resizing things for tablets.

Screenshots


Here are some Screenshots of the app:

Screen Shot 2018-02-15 at 3.56.54 AM.png

Screen Shot 2018-02-15 at 3.56.42 AM.png

Screen Shot 2018-02-15 at 4.15.12 AM.png



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Hey @jaysermendez I am @utopian-io. I have just upvoted you!

Achievements

  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • Seems like you contribute quite often. AMAZING!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

Thank you for the contribution. It has been approved.

You can contact us on Discord.
[utopian-moderator]

You two serious about this project :thumbs_up:
I recently saw a post that listing features of steemia, I didn't get two mainstream part but I guess you are trying to make it more easy to communicate with others.
I'm not a fan of non-native applications but let's see steemia may change my idea.

Forget about the two streamlines. We will take the approach of display data just under our tag. Even though it is not native, performance is good since all images are loaded in a different thread as well as all http requests are not loading into the main thread. Our next step is to incorporate our endpoints to display data. Right now we are getting 50 FPS and I bet we will get 60 FPS after offloading all the calculations from the client side.

Communication will be done using peer to peer technology to allow users to communicate directly without middleware.

And yesh! We are serious about this :)

Coin Marketplace

STEEM 0.28
TRX 0.11
JST 0.031
BTC 69066.32
ETH 3740.86
USDT 1.00
SBD 3.65