ESP32-P4 vs ESP32-S3: LVGL Display FPS, RAM and Power Benchmark Guide

A repeatable LVGL benchmark for ESP32-P4 and ESP32-S3, with matched SPI and native display tests, framebuffer calculations, heap logging and power measurement.

If you run the same LVGL screen on an ESP32-P4Price and an ESP32-S3 and both appear to hit the same FPS ceiling, check the display bus before changing the code. On a single-data-line 40 MHz SPI link, sending 320 × 240 RGB565 pixels takes 30.72 ms even with no gaps. That gives a calculated ceiling of about 32.6 full-screen updates per second. Commands and driver overhead eat into that. A faster processor could spend most of its advantage waiting for the same panel.

The comparison needs two runs. Put the same SPI panel on both boards to see how they handle an equal job. Then test each board on the display you would actually put in a product. Those are different questions, and if you mix the results you lose the answer to both.

This esp32.co.uk/ guide gives you the bench procedure, calculations and places to record what happened. Hardware readings are pending. The figures used to size buffers and explain link limits come from arithmetic, with assumptions shown next to them.

What changes between P4 and S3

The P4 uses dual RISC-V application cores. Espressif’s preliminary datasheet lists up to 400 MHz for the parts it describes, 768 KB of high-performance L2 memory and 16 MB or 32 MB of in-package PSRAM. It has a native MIPI DSI interface and a Pixel-Processing Accelerator, usually called PPA. Check the silicon revision and actual CPU setting on the unit in front of you. The number in the datasheet is the chip specification, and the allocator will report a much smaller amount of memory available for a particular job. ESP32-P4 datasheet

The S3 uses dual Xtensa LX7 application cores, up to 240 MHz, with 512 KB of on-chip SRAM. Some variants have PSRAM. It supports LCD designs using SPI and parallel RGB, and has integrated 2.4 GHz Wi-Fi and Bluetooth LE. The P4 itself has no Wi-Fi or BLE radio. A P4 board with a wireless companion needs that companion included in the power budget if the application uses it. ESP32-S3 datasheet

An advertised memory size can be two different things on the same sticker. The S3 module names N8R8 and N16R8 are a good example. Check the flash setting and the actual PSRAM detection line at boot. You need the PSRAM that the running firmware can allocate, plus enough internal memory for the driver and interrupts. ESP32-S3 flash and PSRAM variants

For native examples, Espressif lists a 1024 × 600 touchscreen on its P4 Function EV Board and an 800 × 480 RGB panel on the S3 LCD EV Board-2. Those kits already differ in resolution, screen and backlight. Record the exact subboard and revision, especially if you have the kit from a different production run. P4 board guide, S3 board guide

Put the same SPI panel on both boards

For the matched run, use one panel module, preferably a known-good 320 × 240 RGB565 SPI module both board ports already support. Move it between boards. Use the same orientation, pixel format, bus clock, cable length, backlight level and panel initialisation settings. A shared model name helps, but using the actual same module also removes unit-to-unit differences in the display and backlight.

Check the pinout of each board and the panel module’s logic and power requirements. Disconnect power before swapping the module. A header marked 5 V on a breakout says little about what its signal pins tolerate. Map clock, data, chip select, data/command and reset against the driver and the board schematic. Use a common ground. For the P4 board in particular, check pin availability against the exact revision and any on-board peripherals. P4 Function EV Board pinout guide

Start at a clock rate supported by the panel and wiring on both units. Read or measure the actual SPI clock before making a bandwidth calculation. Keep the driver transfer queue and the LVGL buffer size equal in the matched run. If you raise the clock or change the queue depth later, give that run another label. Keep the original run. It tells you what you gained from the change.

Try a red, green, blue and white test pattern first. Wrong colours or reversed orientation can make the same animation do different work because one build swaps bytes or rotates in software. Record where the conversion happens. If a board requires a different implementation, write it down. That is part of the measured software path.

Run the native displays as complete systems

The native test is the one I would use for a panel buying decision. Run the P4 on its intended DSI display and the S3 on the RGB or SPI display you would actually ship. Keep the scene recognisable across both. Record native resolution, display timings, LVGL and panel formats, buffer count, touch configuration and visible brightness. If you use different screen sizes, decide whether controls keep the same pixel sizes or scale to fill the display. Either choice changes what the renderer has to draw.

Two useful runs here. First, use each vendor’s ordinary board support package and note the defaults. Then test your realistic configuration, including any tearing prevention, buffering and acceleration you intend to keep. A board that needs a different mode to make the UI usable should be judged as that finished configuration. Keep the configuration that failed as well, with a note about what broke.

Use a single source of scene updates where practical. The panel initialisation and timing belong in the board-specific part. A menu structure, image assets, fonts and animation schedule can be common. If one board’s demo is LVGL 8 and the other uses LVGL 9, port the common workload before comparing. With different LVGL versions the result also includes the effect of the libraries. Existing P4 versus S3 board comparison

Matched SPI panel comparison and separate native-display test for P4 and S3

Lock down the firmware before you chase FPS

Record the chip revision, board revision, ESP-IDF version, board support package and LVGL version. For the example workload in this guide use LVGL 9.3.0 if both ports support it. Retain the effective sdkconfig, component lock file and the build’s map file. On a P4, confirm the SDK supports the silicon revision before copying an older sample. The same part marking can appear across chip revisions, and a different SDK can be needed to boot a particular board. Espressif chip revision identification

Keep the CPU frequency steady for the first comparison, or log the policy and frequency if your firmware changes it. Use the same LVGL configuration where it applies, including colour depth, enabled fonts, image decoder, refresh cadence, task priorities and animation timing. Record whether image assets are loaded from flash, PSRAM or a file system. Save the asset versions. The same source code with a different font or a decompressed image cached in RAM can produce different results.

Build the firmware without verbose serial logging in the render or transfer callbacks. You can instrument the hot path with timestamps or a GPIO and dump the captured data at the end. If enabling the instrument changes the results, run with it on both boards and state the difference. Keep diagnostic builds and release builds labelled. An unoptimised debug build can change the timings you are trying to explain.

Start the matched comparison with a common software drawing path where possible. P4’s accelerator can perform selected operations such as fills, blending and scale/rotate/mirror. Whether it helps depends on what the port sends to it, the memory restrictions, and how long setup and synchronisation take. Compare the same P4 build and scene with the chosen acceleration path toggled where supported. Check output quality before crediting a gain. Espressif PPA driver guide

Calculate the bytes before allocating buffers

In tightly packed RGB565, each pixel takes two bytes. An 800 × 480 frame therefore needs 768,000 bytes, or 750 KiB. Two complete copies take 1,500 KiB. Add actual row stride, padding and allocations that the driver makes. LVGL draw buffers, panel framebuffers and temporary conversion buffers are separate allocations unless your port explicitly shares them.

ResolutionOne RGB565 bufferTwo RGB565 buffers
320 × 240153,600 bytes (150 KiB)307,200 bytes (300 KiB)
480 × 480460,800 bytes (450 KiB)921,600 bytes (900 KiB)
800 × 480768,000 bytes (750 KiB)1,536,000 bytes (1,500 KiB)
1024 × 6001,228,800 bytes (1,200 KiB)2,457,600 bytes (2,400 KiB)

Here is a smaller allocation worth trying on the SPI panel. A draw buffer 320 pixels wide and 40 rows high needs 25,600 bytes at RGB565. Two such buffers take 51,200 bytes before overhead. You can render into one while the panel transfer reads the other if the driver really is asynchronous. With a full-screen update you still send all the pixels, now spread over chunks.

Check the allocated storage format. A panel with a 24-bit input path does not imply the LVGL draw buffer has three bytes per pixel. There may be an RGB565 draw buffer and a conversion step, or a four-byte working format used by the renderer. Compare buffer size and stride from the application with the data width used by the panel driver. A larger framebuffer can solve capacity problems and still lose time to copies if it is in the wrong place.

Calculated RGB565 framebuffer sizes and a 320 × 40 partial draw buffer

The display bus can set the limit

For an SPI command panel, use payload bits divided by the actual single-line SPI clock as a best-case transfer time. At 40 MHz that gives 5 million payload bytes per second at continuous transfer. Dividing by the 153,600 bytes in a 320 × 240 RGB565 frame gives about 32.55 full frames per second. Panel commands, bus gaps, driver setup and any work that fails to overlap take their share. This is a bound for that setup, not a speed that the sample firmware is expected to reach.

Now change a number in a small label instead of the whole screen. An ideal five-percent update at that resolution carries 7,680 pixel bytes. Read the actual flush rectangles, because invalidation may include an older position of a moving object, or the bounding region of several changes. Many short transfers also need repeated commands. Measure the sum of pixels sent and saved bus time. The number of widgets you changed gets you only so far.

For a continuous RGB display, a static screen still needs scanout. At 800 × 480 and 60 Hz with a tightly packed RGB565 framebuffer that is 46.08 MB/s of active pixel reads, before allowing for other memory traffic. The required pixel clock comes from total horizontal and vertical timing including blanking. A real memory system also has contention, and copying or blending can create reads and writes in addition to scanout.

At 1024 × 600 and 60 Hz the corresponding active payload is 73.728 MB/s in RGB565. For DSI, data-lane rate depends on the actual format, lane count and timing configuration. Use the driver and panel timing data. Dividing the RGB565 framebuffer size by a headline DSI lane rate skips both the protocol and the framebuffer side of the work. S3 RGB panel driver, P4 MIPI DSI driver

Set the render mode and track who owns the buffer

In LVGL 9, partial mode allows draw buffers smaller than the screen and uses them to render invalid areas in chunks. Direct mode uses screen-sized buffers and renders changed regions at their framebuffer positions. Full mode also uses screen-sized buffers and redraws the whole screen when a refresh is needed. Record the mode, number of draw buffers and driver framebuffer count. The words double buffering are too vague on their own. LVGL 9.3 display setup

For an asynchronous flush, tell LVGL the buffer is free only when the port can safely reuse it. A call that queued the transfer is usually too early. On SPI, identify the completion event for that transaction in the driver and your port. For continuous scanout, a copy-complete event can release the source of a copy while another buffer is still being displayed. If you hand a framebuffer directly to the driver, follow that driver’s safe reuse or swap rules. A generic VSYNC callback cannot tell you which LVGL frame the hardware used unless you also establish the buffer identity. ESP-IDF SPI LCD driver

When tracking a refresh made up of several chunks, capture the value of lv_display_flush_is_last() inside the flush callback before deferring work. Associate it with the submitted transaction, then process completion in the right order. If nothing was invalidated, the refresh timer can wake with no new pixel work. Counting its wake-ups gives an entirely different number from counting changed frames.

If double buffering makes the screen less stable, trace the buffer states when you see the glitch. For each buffer note when LVGL writes it, when a transfer starts, when that buffer becomes safe, and when the driver begins scanning it. One extra copy can bring frame time up. Letting the renderer overwrite pixels during scanout can bring the FPS number up while leaving a visible seam. Keep the visual result beside the timing.

Measure the frame you mean

The simplest number is application update rate. Count user-visible state changes scheduled by the test, such as one new scroll step or chart sample. The next is completed LVGL refresh rate. Count the completed last chunk of each refresh cycle, retaining failures and missing completions separately. The third is presented content rate. Count changes that actually appear on the panel, with repeated scans of unchanged content excluded. Say which one you report every time you write FPS.

The LVGL benchmark demo can be useful for reproducible rendering scenes. Preserve its version, screen dimensions, enabled options and per-scene results. Take the number the demo reports as a property of that demo and port. It is still worth measuring what the display does. If your board support package uses an older LVGL generation, there may be a benchmark with the same name and different internals. LVGL v9.3.0 benchmark source

For SPI, completed transfer of the final flush chunk is a useful boundary and is observable without optical gear. It marks when the transfer ends, and the panel may continue scanning its own memory afterwards. For RGB or DSI, hardware refresh ticks can stay steady with a frozen UI. Compare the actual contents. A small contrasting marker that changes once per scene step gives you something to follow using a camera or a photodiode positioned over that patch. Check for downstream buffering and duplicate states. A two-state marker can miss an even number of intermediate changes, so use slower, controlled transitions or a visible sequence pattern when counting skips. Report the camera rate or instrument sampling interval, and where on the panel you measured. With top-to-bottom scanout, a patch at the bottom can change later than one at the top.

For touch response, measure from the same starting point on both systems. A timestamp at the touch interrupt measures from that event. If you need finger-to-photon latency, you also need an independently observed input event and visible response. A GPIO toggled when the firmware accepts the touch plus a light sensorPrice gives a narrower measurement that is often much easier to repeat.

LVGL timing boundaries for scene update, render and flush, driver completion and visible presentation

Run a small set of scenes that can tell you something

Start with a static dashboard and leave it displayed with the backlight on. That establishes scanout, system and backlight power with almost no redraw work. Then update one label at a fixed cadence. A small update like this is a good test of whether the port really pushes a region on SPI or sends a full frame every time. Check the flushed pixel count and see if it matches what you expected.

Next scroll a list or a chart with a fixed animation path. Put text on screen and use the same font and assets on both builds. Follow that with a full-screen change, then a scene using an image with opacity or scaling if your product needs it. This separates small dirty areas from peak transfer and from more expensive drawing. Keep touch polling either enabled on both or state why it differs.

Finally run your real screen with the services it normally runs. Maybe Wi-Fi on the S3 is receiving dashboard updates while the P4 board passes requests through a companion. Set the same local update schedule and equivalent functional workload. Include radios, touch and storage in the run only when the profile calls for them. Log the action sequence so you can compare runs that actually did the same jobs.

Pick timing windows before opening the results. A workable starting plan is 10 seconds of warm-up followed by 30 seconds of capture, repeated at least five times for a given scene and configuration. Those are test inputs. Extend the window for sporadic stalls or temperature-related trouble, include a separate startup run if boot matters, and vary which board goes first. Start each run in the same scene state. A long static section followed by a short animation will otherwise make the average look better than the interaction feels.

Check memory at the moments a display asks for it

Take heap snapshots after boot and storage or network setup, after panel and LVGL initialisation, after loading assets, then after the busiest scene. Record separate pools for internal byte-addressable RAM, PSRAM and internal DMA-capable byte-addressable memory. Compare both free bytes and the largest free block. An allocation can fail when total free memory looks adequate because the next buffer needs one contiguous range with the right capabilities.

This small ESP-IDF helper prints the three pools. Call it in task context at the boundaries you already use for logging. The pools can overlap, so keep the rows separate. This captures the allocator’s view. If LVGL uses a private allocator or fixed memory pool, collect that allocator’s statistics too, and record which buffers and stacks are static. ESP32-S3 heap API, ESP32-P4 heap API

#include <stdint.h>
#include <stdio.h>
#include "esp_heap_caps.h"

static void print_pool(const char *name, uint32_t caps)
{
    multi_heap_info_t info = {0};
    heap_caps_get_info(&info, caps);
    printf("%s free=%zu largest=%zu min_free=%zu bytes\n",
           name, info.total_free_bytes, info.largest_free_block,
           info.minimum_free_bytes);
}

void log_display_heap(const char *phase)
{
    printf("Display heap at %s\n", phase);
    print_pool("internal_8bit", MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT);
    print_pool("psram_8bit", MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT);
    print_pool("internal_dma_8bit",
               MALLOC_CAP_INTERNAL | MALLOC_CAP_DMA | MALLOC_CAP_8BIT);
}

Put the helper in the application component and add a private dependency on heap where needed. The minimum field reflects allocator low-water marks, so it can include earlier startup activity and is an aggregate across matching regions. Use the instantaneous fields for before-and-after comparisons and keep the minimum labelled as the allocator’s reported minimum. A zero for the PSRAM pool can mean that PSRAM is unavailable to this allocator or that no bytes remain. Check the boot log and configuration before interpreting it.

In a driver that supports framebuffer allocation in PSRAM, use the driver’s supported allocation or validated alignment rules. On S3 RGB, Espressif documents an option using a PSRAM framebuffer plus two internal bounce buffers. Try that as a separate profile if scanout is unreliable under load. It spends internal memory and CPU copy time, which you can measure. The helper’s internal DMA row is a view of that pool, and the actual driver may use other compatible memory depending on its transfer path. S3 RGB framebuffer and bounce-buffer options

Measure power with the display actually on

Choose the power boundary first. For a touch product, the most useful number is usually the input to the system, including board, display, backlight and any companion that the system needs. If the display is powered separately, log both supplies over the same interval and sum their energies. If you measure only the module supply rail, record what is outside it. Compare the same boundary on both units.

Use the board’s intended supply path and a logger that can handle its current without excessive voltage drop. Check voltage under load at the device if the meter or cable is causing resets or dimming. Check whether the debug lead or powered USB connection supplies another rail. A laptop tether can quietly feed the board around the meter. Keep the measurement at low-voltage board inputs and follow the board’s instructions for separately powered LCD assemblies.

Panel brightness needs a physical match if you compare different displays at equal viewing brightness. If you have a luminance meter, record the target and where it was measured. A shared PWM percentage is reproducible on the same backlight but may look very different across panels. Without a brightness instrument, record the setting and label it as such. Use fixed brightness during each run, with automatic dimming off or documented.

Record mean power over each measured window. If you have voltage and current samples, integrate their product over time. In the discrete case use the sample interval and an integration method appropriate for the logger. With nearly constant voltage, average current multiplied by voltage gives an estimate. Use watts and seconds for joules. If one run uses 1.2 W for 10 seconds, that is 12 J by arithmetic. That example is a conversion, not a board result.

For a repeating animation, divide the measured energy by the number of completed updates at your stated boundary. For a screen session, use energy per completed task, such as opening and scrolling the same menu. Also report idle watts and total joules. A metric such as joules per presented frame makes sense only if both sides are doing comparable useful work. If the workload misses deadlines or drops actions, keep that fact next to the power figure. A static scene with zero completed updates still has an idle power result. Leave the per-update energy undefined for that run.

Whole-system display power measurement including the board, display and backlight

Put the blank numbers next to the configuration

Give each run an ID and keep the raw traces. For a frame-time tail, report a median and p95 from the intervals between distinct completed events at your chosen boundary. Use nearest rank for p95 if you want a simple repeatable calculation. Sort the intervals from smallest to largest and take the one at rank ceiling of 0.95 times the sample count, with rank starting at one. State how many intervals went into it. Keep the scheduled updates, completed updates, dropped steps and longest gaps beside the percentile.

The difference matters in a slow run. If a freeze leaves a long gap between frames, the gap belongs in the interval data. If it remains frozen at the end of the capture, record the unresolved stall and remaining time. With partly completed runs, record the duration and status. Publish the spread across repeated runs. A nice-looking average from the one run that never froze tells you very little.

Profile and deviceSceneCount boundaryFPSp95 interval (ms)Missed steps
Matched SPI / S3
Matched SPI / P4
Native display / S3
Native display / P4
Run and phaseInternal free / largestPSRAM free / largestInternal DMA free / largest
After first boot snapshot
After panel and LVGL init
After assets load
After busiest scene
Profile and deviceBoundary and brightnessIdle wattsLoad wattsJoules per completed job
Matched SPI / S3
Matched SPI / P4
Native display / S3
Native display / P4

Duplicate those rows for the different scenes and repetitions. Keep the deployment notes with the figures. In particular, write down which panel refresh timings and LVGL timer period were in force and which dependencies supplied the flush implementation. It saves a lot of time when one number changes after a BSP upgrade and you need to find out why.

If the result looks wrong, check one boundary at a time

When both SPI boards plateau near the calculated transfer limit, inspect trace time with chip select active and the intervals between transfers. Try the small label workload next. If little changes on screen but the driver sends most of the frame anyway, fix the invalidation or port before increasing the clock. If the same panel only fails at the higher rate, return to the known-good clock and inspect wiring and signal quality.

When the frame counter looks fine and the display tears, look at where the driver swaps buffers and when LVGL starts writing again. Use the actual panel events, inspect the frame identifier if you have one, and run the same scene with one change to buffering. For RGB drift, flicker or corruption under load, check the configured timing and whether the memory path keeps feeding the panel. Vary the pixel clock only within supported panel timings and keep that run separate.

If the largest internal block collapses during image loads, move eligible assets out of internal memory or reduce transient allocation size. Verify that the driver’s buffer still lands in memory it can access. If the PSRAM pool is large but the display sometimes blanks during flash activity, check the driver guidance for your configuration and repeat with the storage job identically scheduled. A failure after enabling multiple services can be memory bandwidth, allocation failure or power sag. The heap and power logs are how you tell those apart.

When the P4 accelerator gives a small or negative change, profile the operations used in that scene. There may be little qualifying work, or buffer movement may dominate. Test a single supported operation on an appropriate buffer and bring it back into the real scene. Keep the accelerated result only if it meets the same visual and memory requirements.

Choose on the scene and the panel you need

For a small dashboard with sparing redraws and built-in Wi-Fi, the S3 is a reasonable first board to test. Check its worst frame gaps and internal DMA headroom when the connection is busy. For a larger DSI display or a design that needs several framebuffers and more image work, the P4 is the natural candidate to test. If the product needs Wi-Fi, include the companion path in both the workload and power scope.

Set acceptance limits for the actual product. A wall display showing changing temperatures can have a very different frame budget from a control that must respond promptly to touch. Decide how much RAM must remain for the rest of the firmware and how long the system normally spends with its backlight on. Run those conditions. The result worth publishing is the measured behaviour of the board, panel and firmware that met the job, with enough detail for somebody else to check it.

CONTINUE EXPLORING / ESP32 & ELECTRONICS

Read next

Practical guides related to this article.

Explore the topic →
HARDWARE DECISION GUIDEWhich ESP32 board should you use?

Compare practical options before you choose hardware.

Compare options →