Advice with making the right GUI choices

Hi, I'm interested in writing a profiling data viewer. To those not familiar with the term, it's a viewer of CPU activity recorded during a period of time, the view is composed of several lines (each per CPU core) with horizontal scrollable timeline (see image). There's not much animation going on, the hardest problem with such applications is handling very large amounts of data (events), and responding quickly to zoom, panning, etc.

For the last 10 years the app was developed in python, and I think it's time to move to a different environment in order to support the growing needs.

Rust looks like a good choice, I also tend to work with egui since it seems straightforward in many ways (using a Qt porting looks very complex, when looking at examples).

  • Is egui indeed the right choice for me, being immediate? I'm not looking for animation/etc., just drawing data fast.
  • What kind of widget would you use to draw the data? And is there a boilerplate / standalone example? Writing from scratch looks difficult to me ATM, I need some leverage to get going.

Thanks
Sharon

1 Like

It depends alot on the data to be displayed and the frequency of update.

If everything is pure text, you can probably get away with GitHub - ratatui-org/ratatui: Rust library that's all about cooking up terminal user interfaces (TUIs)

If you need to manipulate DOM elements (canvas, svg), GitHub - Pauan/rust-dominator: Zero-cost ultra-high-performance declarative DOM library using FRP signals for Rust! has a nice frp framework.

If you need ultra high performance, WebGL2 / WebGPU is the way to go, but at that point you have to deal with things like text rendering (commonly done via sdf) + mouse picking (commonly done via rendering to an aux buffer the object_ids of the screen, then reading back what object_id is under the cursor.)

2 Likes

rerun is a similar kind of application which you might want to look at for inspiration.

thanks a lot! as i mentioned, it's not pure text, it's very graphical, but it's not high performance and also does not involve DOM. it's more like the image i posted, but for large quantities of events, each with start and end timestamp.

Maybe have a look at GitHub - hacknus/serial-monitor-rust: A cross-plattform serial monitor/plotter written entirely in rust.. It's written with egui. You could just try feeding it a lot of data to check if its fast enough.

Thanks Sebastian, yes it is pretty close to what I'm looking for, however I'm looking for a case using canvas-stile painting, and not the egui Plot widget, since I won't be drawing graphs. But still it is very helpful, thanks!

If you're open to using Flutter as GUI, Rinf might be able to help you. Flutter has many high-quality graph libraries and is fully compatible with multiple platforms. I'm currently maintaining this framework and it should be very fast and easy to use.

Sadly Rinf demos are not working in my Safari on MacBook Pro M1.

You must be using Safari 15.5 or higher to use Rinf. This is because 'nested web workers(thread)' was enabled in that version. This is a necessary constraint, because nested web workers are crucial for optimal performance on the web.

I'm curious.

I understand the importance of "no webworkers" -> "have webworkers". However, what does "have webworkers" -> "nested webworkers" achieve, and why does a ... UI FRAMEWORK ... need this ? :slight_smile:

Besides possibly a dedicated webworker for computing diffs on a virtual dom ... why is there dedicated nested webworkers ?

I have Safari 16.2 on this MacBook Pro M1.

bringing back the discussion to the topic :slight_smile: i'm still in need of a series of simple, self-contained examples of using egui to learn from and build upon, in order to better understand if it's the right choice for me. thanks

1 Like

Sorry for taking part in derailing the topic (I misread it as looking for gui library choices, not looking for egui examples).

At this point, I'd recommend creating a new post clearly stating (in topic) that you're looking for egui examples. [I've had topics derailed in the past, and it's easier to new post]

1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.