They're here, the MNPI: Much Needed Performance Improvements,
or, what some Englishmen like to pronounce as "the speeeeeeeeed".

by Bubble Punk

While developing pwr.news, I have noticed the app is susceptible to a plucky portion of induced demand: every time I'm proud to say the interface has just become a lot faster or more easily navigable, the first obvious thing to note is that the back-end can't follow.

Last time's improvements were no exception: zooming out quickly meant you had to wait for ages for news to appear. The culprit on the back-end was the calculation of item scores and activity. Those scores are dependent on all discussions on a certain item, so while filling charts with, let's say 30 items, still thousands of items needed to be fetched from our database.

The theoretical fix for the back-end was easy: use cached scores instead of fetching whole discussion trees and only recalculating things when needed. However, upon implementation, it introduced a lot more edge case bugs than expected.

tl;dr
Going from "stable, but slow", to "fast, but buggy" was easy, but the trenches of development hell needed to be crossed to end up at "stable and fast!"

More fixes

  • Fixed 'undefined' in titles on page load.
  • Fixed chart not opening news item on page load.
  • Fixed out-of-bound items.
  • Fixed impossibility to zoom in on Firefox.
  • Reduced amount of price chart ticks on small screens.
  • Fixed missing /BTC and /ETH quoted asset pairs.
  • Fixed irrelevant news items reappearing after being hidden.
  • Fixed missing prices or price charts after server reloads.
  • Fixed price charts not covering complete area on mobile devices.