Giter Site home page Giter Site logo

Comments (3)

natecraddock avatar natecraddock commented on May 14, 2024

Hi @mizlan!

This is something I have thought about from time to time. My personal use case for zf is usually within the scope of a single project, so I rarely have over 10,000 files to read into zf. This means I haven't given much thought to a incremental display.

As you have observed, the current zf implementation is blocking. All of stdin is read into a buffer which is then split on lines. Those lines are then given to the UI code. The UI only runs the filtering on keypresses. So that's why you are seeing the current behavior.

But I am planning on adding a UI preview feature sometime soon (once the next Zig version is released): #25. It seems like the next version will be the end of the month.

That feature will require me to rework the event loop to be more async. As part of that, I think it would not be difficult to read from stdin in batches to make the UI immediately available.

Another side to this is multithreading the filtering of zf. For large batches of input lines, the other issue would be making sure the filtering is very fast.

Feel free to let me know your thoughts on that!

from zf.

mizlan avatar mizlan commented on May 14, 2024

My personal use case for zf is usually within the scope of a single project, so I rarely have over 10,000 files to read into zf

Same! I was just curious I guess, it isn't a real problem for me almost ever in practice.

Another side to this is multithreading the filtering of zf. For large batches of input lines, the other issue would be making sure the filtering is very fast.

I think multithreading would be very very cool and interesting to see! Though I am interested in the Zig language, I am not super experienced in writing multithreaded programs, so I'm afraid I can't contribute too much, but I will be excitedly watching for updates to zf :)

from zf.

natecraddock avatar natecraddock commented on May 14, 2024

Same! I was just curious I guess, it isn't a real problem for me almost ever in practice.

In that case I'll keep this issue open, but wait and see if there is someone with that use case. I am open to it right now, but I don't want to implement it if I don't need to.

I think multithreading would be very very cool and interesting to see! Though I am interested in the Zig language, I am not super experienced in writing multithreaded programs, so I'm afraid I can't contribute too much, but I will be excitedly watching for updates to zf :)

I'll probably get to this in the next few weeks if everything goes according to plan :)

from zf.

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.