Size and speed#

CEUI runs on a 48 MHz eZ80 with about 154 KB of RAM, in programs of at most 64 KB and in flash apps. This page gives the measured numbers and explains where the size and time go.

Only what you use#

CEUI is not a LibLoad library. Its sources are compiled into your program, and the toolchain’s link time optimization turns your program and CEUI into one module, from which the linker drops every function and const object nothing refers to. Four rules in CEUI keep that working:

  1. Each widget is a plain function, and nothing lists all widgets, so nothing keeps an unused one alive.

  2. Each style part is its own const object. ui_button refers to ui_style_button and nothing else does, so a program without buttons ships no button style. Glyphs work the same way.

  3. Each recorded command carries a pointer to its own draw function, so the renderer has no switch over all kinds and a program without sprites links no sprite drawer.

  4. Optional machinery, like toast drawing and whole-canvas redraws, is reached through pointers that ui_toast and ui_canvas set, so only programs that call them link it.

There is no float and no printf; ui_fmt is a small formatter of its own.

Measured sizes#

Measured on 2026-12-01 with -Oz and LTO, in CEbox. CEUI’s test run fails when a program grows past its guard.

Program

Size

Guard

HELLOUI.8xp, the hello example

17,280 bytes

18,000

CEUITOUR.8xp, the showcase with every widget

47,477 bytes

50,500

GALLERY.8xp, a test program with most widgets

37,318 bytes

40,000

The core that every program links (frame loop, navigation, layout, recording, comparison, drawing, text and input) is about 14 KB of eZ80 code. Widgets add to that as you use them.

RAM is 11.1 KB of .bss in programs and apps alike: 8 KB of command pages, 1 KB of focus table and about 2 KB for the rest. There is no heap use. See configuration to change the buffer sizes.

On the calculator, graphx is a LibLoad library that nearly every calculator already has, so it adds nothing to your program.

Measured speed#

Measured on 2026-12-01 in CEbox, from the key press until the program waits for the next key. CEUI’s test run fails when a scenario gets slower than its guard.

What

Measured

Guard

Moving focus in the showcase’s Controls screen

36 to 53 ms, one frame

60 ms

Moving the selection in the home list

59 to 116 ms, two frames

130 ms

Opening a showcase screen

114 to 436 ms; the slowest include the screen’s own setup (Files builds and sorts 500 entries)

480 ms

Where the time goes#

When nothing changes, CEUI does no drawing work: the frame loop waits for a key or a timer. When something changes, each frame is compared command by command with the frame before, and only the 64 by 16 pixel tiles under changed commands are drawn again, into the back buffer, then copied to the screen.

graphx sets a floor under that. Measured in a separate test program, graphx alone needs 2.4 ms to fill a 320 by 48 strip, 2.4 ms to copy it to the screen, 6.7 ms to print three short labels into it, and 5.3 ms to clear the screen once. A focus move redraws two such strips, so about 20 ms of it is graphx before CEUI does anything. CEUI’s own share is building the frame (about 19 ms) and comparing the pages (about 5 ms).

Keeping your program fast#

  • Do not call ui_wake(0) in every frame unless something really animates; each frame costs at least the time to build it.

  • Keep long lists in ui_list_begin, which builds only the visible rows, rather than a scroll area full of labels.

  • Put long text in a scroll area, so lines that are not visible are not recorded.

  • Change a canvas’s version only when its picture changed.