Giter Site home page Giter Site logo

Scroll lag on key hold about steam-tui HOT 5 CLOSED

dmadisetti avatar dmadisetti commented on September 8, 2024 1
Scroll lag on key hold

from steam-tui.

Comments (5)

mbpowers avatar mbpowers commented on September 8, 2024 1

It's only when you hold it down.

Never touched rust but as it's so popular I figured I should dip my toes in, and this seems like a good project to join in on the fun. I might try and take a stab at some of these but don't wanna get your hopes up in case I fail or don't have time haha.

Also not getting the auto-downloaded icons ¯\(ツ)

from steam-tui.

dmadisetti avatar dmadisetti commented on September 8, 2024

Thanks 🎉 !

Hm, I haven't really noticed this. Is it for rapid pressing or when you hold down? There do definitely need to be more filters (DLCs, demos, other than games; see #11)
You can search, but that doesn't address the issue.
I have 2 theories:

  1. When you hit a new game, theres a blocking call to get an image if one does not exist (only the first time though). That could be the slow down, but should be better once you have scrolled the library. Changing the image to ANSI is also blocking.
  2. Since there's no debouncing in place, the event is triggered multiple times causing issues.

It might be both lol.

To address 1. we'd need background downloads (which actually couples with the proposed async implementation of #29), and/or ANSI caching. I think this is going to be a change to the widget itself. The original author is unresponsive, so we're working off this fork: https://github.com/AnotherGroupChat/tui-image/tree/rgba

To address 2 we need some debouncing logic, which I think is straightforward? Something I've never had to implement, but would probably require a change to the event handling:

impl Events {

anyway, I don't expect anyone to fix this, just suggesting solutions to the ether. When/if I do start working on this program again, I think this, #29, and #8 will be noticable speed improvements.

from steam-tui.

mbpowers avatar mbpowers commented on September 8, 2024

Figured out why I'm not getting the images its cause I pulled the steam-tui instead of steam-tui-git from AUR. false alarm!

from steam-tui.

dmadisetti avatar dmadisetti commented on September 8, 2024

Yeah, I think rust is fun. If it's only on hold down, then # 2 (debouncing) is likely the issue.

So there are 2 event types, one is a timed event (we want the main loop to run every so often to communicate with the client thread), the other is an event loop (we want to respond to a user push). So debouncing means that we should not stack events, but wait an interval before the one next event queues. I think? There's probably better explanations online (all my quick Googling points me at JavaScript examples though). Good luck! Let me know if you run into any problems, and checkout Some basic rust documentation first: https://learnxinyminutes.com/docs/rust/

Rust is weird at first, but pretty powerful once you understand its quirks

from steam-tui.

dmadisetti avatar dmadisetti commented on September 8, 2024

Yeah I see it. It overshoots and i slow to take off. Managing the event queue is the right way to do this.

from steam-tui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.