Giter Site home page Giter Site logo

Comments (8)

ynqa avatar ynqa commented on May 16, 2024 4

I suppose some async/await could help with not freezing the TUI
The biggest usability problem for large files is that keystrokes are delayed

@corneliusroemer You're absolutely right; there's a potential to degrade user experience.

jnv utilizes the mechanisms from promkit, where I'm considering implementing a system that can handle keystrokes and data structure editing concurrently using async/await at promkit (I've tried this before, but it's been a bit challenging and is currently pending).

from jnv.

ynqa avatar ynqa commented on May 16, 2024 1

@corneliusroemer Thanks for your reporting! 👍

Could you share the actual JSON, if possible? I'd like to test it myself and understand the current data size limits.

from jnv.

ynqa avatar ynqa commented on May 16, 2024 1

@corneliusroemer fx and jless are indeed famous for their ability to display content very quickly.

On the other hand, jnv relies on the processing speed of libjq, so it can take time to handle very large JSON files. For example, you can see how long it takes by running cat test.json | jq.

I believe there can be a division of use cases: utilize fx or jless when you want to get an overview of the large JSON, and use jnv when you want to try out complex queries with jq for the mid-size JSON.

fx and jless do allow for field lookup with .path.to.field and have some simple DSL query capabilities, but I understand that they cannot handle complex queries like jq can.

from jnv.

corneliusroemer avatar corneliusroemer commented on May 16, 2024

Sure, here we go: test.json

I've meanwhile found fx to be very good for such large JSON files, don't even notice any slowdown at all.

from jnv.

corneliusroemer avatar corneliusroemer commented on May 16, 2024

Thanks for the detailed reply. I suppose some async/await could help with not freezing the TUI - but the added complexity may well not be worth it. The tool would still be usable with the 16MB file if it simply didn't show output until say 3s after the last keystroke.

The biggest usability problem for large files is that keystrokes are delayed.

from jnv.

rocurley avatar rocurley commented on May 16, 2024

Hey, I wrote a similar project a while ago: Jex. While the UI looks a lot better here, I didn't have this problem. I believe the difference is that I parsed the JSON once at load and then used the parsed structure from there on out.

Looking at your code, you already parse the output to json so you're in a pretty good spot there. Even if you don't think it's worth it to switch your rendering code to use JQ's internal representation, I bet you could convert from JQ's representation to yours a lot faster if you didn't go through a string representation between the two.

from jnv.

rockwotj avatar rockwotj commented on May 16, 2024

I would recommend Jaq, it's native rust and you can won't have to convert each time, and was built to fix some speed cases with many filters compared to jq.

https://docs.rs/jaq-interpret/latest/jaq_interpret/

from jnv.

ynqa avatar ynqa commented on May 16, 2024

@rockwotj Regarding the replacement with jaq, I have created #24, so please provide your opinions/reactions there 🙏

from jnv.

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.