Comments (8)
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.
@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.
@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.
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.
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.
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.
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.
@rockwotj Regarding the replacement with jaq, I have created #24, so please provide your opinions/reactions there 🙏
from jnv.
Related Issues (20)
- Feature Request: Support JSON stream HOT 8
- Feature: Configure the highlighted 'current' line to NOT be at the top of the screen
- Add jnv to homebrew-core HOT 2
- Not running by default on AlmaLinux 8
- ENH: Support newline delimited JSON (ndjons/jsonl) HOT 7
- Colours are unreadable when used with a light terminal background. HOT 1
- It's a very cool tool, does it work on bash? or it depends on system(Linux/MacOS)? HOT 4
- blinking when using xterm -cm HOT 4
- jnv cannot trigger auto-completion while use array HOT 1
- feature request: Publish as a docker image HOT 5
- Releasing armv7 and arm64 binaries HOT 1
- Fails to execute jq query when the key starts with `@` symbol HOT 4
- Feature Request: configure keymap/colors
- How about replacement `jq` with `jaq`? HOT 5
- Feature Request: Copy current JSON displayed HOT 2
- ENH: Add `-s` slurp mode, turning json-lines into an array
- What terminal settings should you use?
- Specify default query
- Feature Request: Write the output to stdout
- [FR] Support for query history
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jnv.