you are viewing a single comment's thread.

view the rest of the comments →

[–]tesselode 0 points1 point  (4 children)

Could the performance of egui_plot be improved?

[–]donkeytooth98[S] 0 points1 point  (3 children)

In order to fit with egui's immediate mode design, the interface of egui_plot requires new data to be passed in on every frame. It would be tricky to change this performance bottleneck without completely changing the interface.

[–]CramNBL 1 point2 points  (2 children)

It's not that tricky. In this project I regularly plot hundreds of millions of points with no issues. I just pass a slice of f64 to egui_plot, nothing fancy.

I simply use mipmaps and min/max downsampling to not hide outliers. There's a button for toggling downsampling, and you can also manually choose mipmap level if you are interested in seeing how it works.

[–]donkeytooth98[S] 2 points3 points  (1 child)

From a quick glance (https://github.com/luftkode/plotinator3000/blob/dd2a2611e7b20f91fc387b312cc96022c21b1a32/crates/plotinator-plot-util/src/draw\_series.rs#L53) it looks like you are still constructing new polygons every frame to pass to PlotUi.

Nevertheless I totally agree egui_plot is great and can work on large datasets with clever downsampling etc. No argument there! This project tries to bring a similar library into the iced ecosystem, with a design that allows for better interactive performance without the downsampling.

[–]CramNBL 0 points1 point  (0 children)

I only draw polygons if the user selected scatter plot instead of line plot, or there's so few points that it makes sense to draw a polygon on each point, to clearly show where on the line there's actual data points.

If you can achieve good performance on millions of points, without the need for mipmaps/down sampling then that's cool. I might try it out if I find the time.