• xthexder@l.sw0.com
    link
    fedilink
    English
    arrow-up
    4
    ·
    edit-2
    5 months ago

    Okay, maybe exponential is the wrong math term, but my point is, the complexity grows with number of digits. Infinite scrolling is therefore impossible because eventually it will become too slow to keep up with scrolling. You may be right that it may go farther than any human is willing to scroll, but that depends on the human and if they’re on a potato phone.

    As far as I know, the current fastest algorithm is the Bailey–Borwein–Plouffe formula, which is O(n log n) to calculate the nth digit (not even the whole number). Infinite scrolling is only possible if we can calculate the nth digit in O(1) time.

    • mozz@mbin.grits.dev
      link
      fedilink
      arrow-up
      8
      ·
      5 months ago

      Oh shit! Yeah, it looks like as of 2022 that article I linked to needs to be updated. It should say O(n log n), yes.

      That said, scrolling ever-farther on a web page will always get slower the further down you go, and eventually fail, because of memory allocation. If you ignore some of the factors that make all truly-infinite pages impossible, and require an O(1) algorithm to generate numbers within the inherently-more-than-O(1) process of rendering the page in the first place, then sure, it’s impossible. My point is, the asymptotic complexity is low enough that you can make a page that does it and it’ll work in practice.