• Ephera
      link
      fedilink
      English
      arrow-up
      14
      ·
      15 days ago

      I mean, it does scale with the size of the input. Just not with the count of inputs, but rather the size of each input element.

        • Ephera
          link
          fedilink
          English
          arrow-up
          2
          ·
          15 days ago

          Oh yeah, I do think setTimeout executes in parallel, so only the largest element determines the execution time. It was difficult enough to make that sentence make sense, so I didn’t want to cram that detail in as well. 🙃

  • limer
    link
    fedilink
    arrow-up
    7
    ·
    15 days ago

    If it is stupid and it works it’s not stupid.

    I’m going to use it

  • Vinapocalypse
    link
    fedilink
    arrow-up
    4
    ·
    edit-2
    13 days ago

    PR:

    -  setTimeout(() => console.log(item), item)
    +  setTimeout(() => console.log(item), Math.log(item))
    

    Comment: This will speed up sort time greatly. However, sort order may become erratic for longer lists, and lists with numbers less than 1