-
Notifications
You must be signed in to change notification settings - Fork 10
Description
Hi,
I am opening an issue here that is related to the following issues in other projects:
- glimmer-dsl-libui: How to speed up drawing thousands of elements AndyObtiva/glimmer-dsl-libui#55
- libui-ng: glcanvas? libui-ng/libui-ng#79 (this issue is not directly related, but the comments at the bottom of the issue include a solution to the problem above)
The work that needs to be done was mentioned in these comments on the libui-ng issue:
@kojix2 : kou measured the time required to call a C function from Ruby with FFI and native C extension and concluded that FFI consumes about 10 to 100 times longer.
@cody271 : I would suggest a native C extension just for the uiDraw calls, the rest of the bindings for controls can stay FFI.
As you already saw on Twitter, I announced that a 2-hour workshop that I proposed for RubyConf 2023 was accepted for November 13, 2023 (Workshop Title: How To Build Desktop Applications in Ruby): https://rubyconf-2023.sessionize.com/session/531448
Just like how I announced a new release of glimmer-dsl-libui in RubyConf 2022 that you helped contribute to in a new release of LibUI, it would be great if I could announce in RubyConf 2023 a new release of glimmer-dsl-libui that includes optimized area drawing via an optimized LibUI Ruby binding with a C extension for the uiDraw calls only (LibUI.draw_* methods like draw_path_arc_to, draw_path_line_to, and draw_path_add_rectangle).
If that is not possible by November 13, 2023, then if you could make a new release by then to resolve other simpler issues or expose new behavior from libui-ng, that would be great too (unless you have already exposed all the latest features in libui-ng).
Otherwise, it would still be useful to have this optimization implemented eventually as it would be great for a variety of graphical applications like games, live diagramming applications with thousands of nodes, and analytical applications.