ESP32-S3 high cpu for simple 2 button code

Hi,
I am trying to set up a simple example on an esp32-s3. I am using tft_espi lib for driving the display and for resistive touch. I am getting about 33fps but the cpu is at about 50% just sitting there and goes up to 90% if I do anything. My example has only 2 buttons but The widget example also exhibits this behavior except the cpu goes up to 99% if I scroll or do anything with it. Here is the info on the gear.

display: random Chinese ILI9486 driven display with resistive touch at 480x320
libs: bodmer/TFT_eSPI@^2.4.70 and lvgl/lvgl@^8.2.0
framework: arduino

I have tried other drivers and ways of getting better CPU including the native esp32 idf version and drivers but have had no luck. I also tried pinning the gui to cpu 1 but that made things worse. The only thing that has help is to increase the delay from 5 to 100 in the loop function. That got me to about 20% CPU idle but I do notice a pretty noticeable lag with touch and other things.

Here is my code.

#include <Arduino.h>
#include "FS.h"
#include <SPI.h>
#include <TFT_eSPI.h> // Hardware-specific library
#include "lvgl.h"

lv_disp_drv_t disp_drv;
lv_indev_drv_t indev_drv;

lv_obj_t *btn1;
lv_obj_t *btn2;
lv_obj_t *screenMain;
lv_obj_t *label;

char txt[100];
lv_obj_t *tlabel; // touch x,y label

/*Change to your screen resolution*/
static const uint16_t screenWidth = 480;
static const uint16_t screenHeight = 320;

static lv_disp_draw_buf_t draw_buf;

static lv_color_t* buf1 = (lv_color_t*) heap_caps_malloc(LV_HOR_RES_MAX * 40 * sizeof(lv_color_t), 1<<3);
static lv_color_t* buf2 = (lv_color_t*) heap_caps_malloc(LV_HOR_RES_MAX * 40 * sizeof(lv_color_t), 1<<3);

TFT_eSPI tft = TFT_eSPI(); /* TFT instance */

/* Display flushing */
void my_disp_flush(lv_disp_drv_t *disp, const lv_area_t *area, lv_color_t *color_p)
{
    uint32_t w = (area->x2 - area->x1 + 1);
    uint32_t h = (area->y2 - area->y1 + 1);

    tft.startWrite();
    tft.setAddrWindow(area->x1, area->y1, w, h);
    tft.pushColors((uint16_t *)&color_p->full, w * h, true);
    tft.endWrite();

    lv_disp_flush_ready(disp);
}

/*Read the touchpad*/
void my_touchpad_read(lv_indev_drv_t *indev_driver, lv_indev_data_t *data)
{
    uint16_t touchX, touchY;

    bool touched = tft.getTouch(&touchX, &touchY, 600);

    if (!touched)
    {
        data->state = LV_INDEV_STATE_REL;
    }
    else
    {
        data->state = LV_INDEV_STATE_PR;

        /*Set the coordinates*/
        data->point.x = touchX;
        data->point.y = touchY;

        sprintf(txt, "Touch:(%03d,%03d)", touchX, touchY);
        lv_label_set_text(tlabel, txt); // set label text
    }
}

static void event_handler_btn(lv_event_t *event)
{
    /*The original target of the event. Can be the buttons or the container*/
    lv_obj_t *target = lv_event_get_target(event);
    if (target == btn1)
        lv_label_set_text(label, "Hello");
    else if (target == btn2)
    {
        lv_label_set_text(label, "Goodbye");
    }
}

void setup()
{
    tft.init();
    tft.initDMA();

    lv_init();

    // Set the rotation before we calibrate
    tft.setRotation(1);

    lv_disp_draw_buf_init(&draw_buf, buf1, buf2, LV_HOR_RES_MAX * 40);

    /*Initialize the display*/
    lv_disp_drv_init(&disp_drv);
    /*Change the following line to your display resolution*/
    disp_drv.hor_res = screenWidth;
    disp_drv.ver_res = screenHeight;
    disp_drv.flush_cb = my_disp_flush;
    disp_drv.draw_buf = &draw_buf;
    lv_disp_drv_register(&disp_drv);

    /*Initialize the (dummy) input device driver*/
    lv_indev_drv_init(&indev_drv);
    indev_drv.type = LV_INDEV_TYPE_POINTER;
    indev_drv.read_cb = my_touchpad_read;
    lv_indev_drv_register(&indev_drv);

    screenMain = lv_obj_create(NULL);

    tlabel = lv_label_create(screenMain);         // full screen as the parent
    lv_label_set_text(tlabel, "Touch:(000,000)");   // set label text
    lv_obj_align(tlabel, LV_ALIGN_TOP_RIGHT, 0, 0); // Center but 20 from the top

    label = lv_label_create(screenMain);
    lv_label_set_long_mode(label, LV_LABEL_LONG_WRAP);
    lv_label_set_text(label, "Press a button");
    lv_obj_align(label, LV_ALIGN_CENTER, 0, 0);
    lv_obj_set_size(label, 240, 40);
    lv_obj_set_pos(label, 0, 35);

    btn1 = lv_btn_create(screenMain);
    lv_obj_add_event_cb(btn1, event_handler_btn, LV_EVENT_CLICKED, NULL);
    lv_obj_set_pos(btn1, 32, 100);;

    lv_obj_t *label1 = lv_label_create(btn1);
    lv_label_set_text(label1, "Hello");

    btn2 = lv_btn_create(screenMain);
    lv_obj_add_event_cb(btn2, event_handler_btn, LV_EVENT_CLICKED, NULL);
    lv_obj_set_pos(btn2, 142, 100);

    lv_obj_t *label2 = lv_label_create(btn2);
    lv_label_set_text(label2, "Goodbye");

    lv_scr_load(screenMain);
}

void loop()
{
    lv_task_handler();
    delay(5);
}

If anyone has any ideas on how to get this to decent cpu levels please chime in.

Thank you

Just in case here are my build flags.

build_flags = 
	-D USER_SETUP_LOADED=1
	-D ILI9486_DRIVER=1
	-D TFT_WIDTH=480
	-D TFT_HEIGHT=320
	-D TFT_CS=10
	-D TFT_MOSI=11
	-D TFT_SCLK=12
	-D TFT_MISO=13
	-D TFT_DC=14
	-D TFT_RST=15
	-D TOUCH_CS=16
	-D LOAD_GLCD=0
	-D LOAD_FONT2=0
	-D LOAD_FONT4=0
	-D LOAD_FONT6=0
	-D LOAD_FONT7=0
	-D LOAD_FONT8=0
	-D LOAD_GFXFF=0
	-D SMOOTH_FONT=0
	-D TFT_INVERSION_OFF=1
	-D SPI_FREQUENCY=60000000
	-D SPI_READ_FREQUENCY=17000000
	-D SPI_TOUCH_FREQUENCY=2500000
	-D LV_HOR_RES=480
	-D LV_HOR_RES_MAX=480
	-D LV_VER_RES=320
	-D LV_VER_RES_MAX=320
	-D LV_USE_PERF_MONITOR=1