Why is this program so slow

I Have a program built from ESPASyncTCP client/server example programs but it sems like the program is sluggish. if i try to send a message every 500ms it will for a few times then freeze up for 10 seconds and repeat. Any way i can speed things up?

Send,

#include <ESP8266WiFi.h>
#include <ESPAsyncTCP.h>

extern "C" {
#include <osapi.h>
#include <os_type.h>
}

#include "config.h"
#define SSID "ESP-TEST"
#define PASSWORD "123456789"
#define SERVER_HOST_NAME "esp_server"
#define TCP_PORT 7050
#define DNS_PORT 53
unsigned long now =0;
struct sampleStruct {
  int var1 = 253;
  //byte Array[20];
  float var2 = 5.5;
  unsigned long var3 = 999;
  unsigned long var4 = 1;
  unsigned long var5 = 9999;
  unsigned long var6 = 7777;
  unsigned long var7 = 6666;
  unsigned long var8 = 5555;
  // bool var9;
};
sampleStruct st;
AsyncClient* client = new AsyncClient;
static os_timer_t intervalTimer;

static void replyToServer(void* arg) {
  AsyncClient* client = reinterpret_cast<AsyncClient*>(arg);
  // send reply

  
}

/* event callbacks */
static void handleData(void* arg, AsyncClient* client, void *data, size_t len) {
  Serial.printf("\n data received from %s \n", client->remoteIP().toString().c_str());
  Serial.write((uint8_t*)data, len);
  //os_timer_arm(&intervalTimer, 500, true); // schedule for reply to server at next 2s
}
void onConnect(void* arg, AsyncClient* client) {
  Serial.printf("\n client has been connected to %s on port %d \n", SERVER_HOST_NAME, TCP_PORT);
  //replyToServer(client);
}
void setup() {
  Serial.begin(115200);
  delay(20);
  WiFi.mode(WIFI_STA);
  WiFi.begin(SSID, PASSWORD);
  while (WiFi.status() != WL_CONNECTED) {
    Serial.print('.');
    delay(500);
  }

  client->onData(&handleData, client);
  client->onConnect(&onConnect, client);
  client->connect(SERVER_HOST_NAME, TCP_PORT);

//  os_timer_disarm(&intervalTimer);
//  os_timer_setfn(&intervalTimer, &replyToServer, client);
//  os_timer_arm(&intervalTimer, 500, true);

}


void loop() {
    if (millis() - now >= 800) {
        if (client->space() > 32 && client->canSend()) {
    client->add("NODE02", 7); //add verification1
    client->add((char *)&st, sizeof(sampleStruct));
    client->add("NODE02", 7); //add verification2
    client->send();
        }
    Serial.println("sent");
 // replyToServer(client);
  now = millis();
    }
}

void testFunction(  void* arg, AsyncClient* client){
  if (millis() - now >= 1000) {

   // AsyncClient* client = (AsyncClient);
    //replyToServer(void);
    
  }
}

Receive,

#include <ESP8266WiFi.h>
#include <ESPAsyncTCP.h>
#include <DNSServer.h>
#include <vector>
#include "config.h"

#define SSID "ESP-TEST"
#define PASSWORD "123456789"
#define SERVER_HOST_NAME "esp_server"
#define TCP_PORT 7050
#define DNS_PORT 53


static DNSServer DNS;
struct sampleStruct {
  int var1 = 99;
  //byte Array[];
  float var2 = 0;
  unsigned long var3 = 0;
  unsigned long var4 = 0;
  unsigned long var5 = 888;
  unsigned long var6 = 0;
  unsigned long var7 = 0;
  unsigned long var8 = 0;
  //  bool var9 = 0;
};
sampleStruct st;

static std::vector<AsyncClient*> clients; // a list to hold all clients


char verifyStart[7];
char verifyEnd[7];
static void handleData(void* arg, AsyncClient* client, void *data, size_t len) {
  sprintf (verifyStart,(char *)data, 6 );
  sprintf (verifyEnd,(char *)data + 7 + len - 14, 6 );
  if (strcmp(verifyStart, "NODE01") == 0) {
    if (strcmp(verifyEnd, "NODE01") == 0) {
      Serial.println("Node01");
      //Update Node01 struct
    }
  }
    if (strcmp(verifyStart, "NODE02") == 0) {
    if (strcmp(verifyEnd, "NODE02") == 0) {
        Serial.println("Node02");
      //Update Node02 struct
    }
  }
    if (strcmp(verifyStart, "NODE03") == 0) {
    if (strcmp(verifyEnd, "NODE03") == 0) {
      //Update Node03 struct
    }
  }
    if (strcmp(verifyStart, "NODE04") == 0) {
    if (strcmp(verifyEnd, "NODE04") == 0) {
      //Update Node04 struct
    }
  }
  //etc
  Serial.printf("\n data received from client %s \n", client->remoteIP().toString().c_str());
  //  memcpy(&st, data + 7, sizeof(sampleStruct));
  //  Serial.write((const char *)data, 7);

//  if (client->space() > 32 && client->canSend()) {
//    char reply[32];
//    sprintf(reply, "this is from %s", SERVER_HOST_NAME);
//    client->add(reply, strlen(reply));
//    client->send();
//  }
}

/* server events */
static void handleNewClient(void* arg, AsyncClient* client) {
  Serial.printf("\n new client has been connected to server, ip: %s", client->remoteIP().toString().c_str());

  // add to list
  clients.push_back(client);

  // register events
  client->onData(&handleData, NULL);
}

void setup() {
  Serial.begin(115200);
  delay(20);
  Serial.println("server");
  // create access point
  while (!WiFi.softAP(SSID, PASSWORD, 6, false, 15)) {
    delay(500);
  }

  // start dns server
  if (!DNS.start(DNS_PORT, SERVER_HOST_NAME, WiFi.softAPIP()))
    Serial.printf("\n failed to start dns service \n");

  AsyncServer* server = new AsyncServer(TCP_PORT); // start listening on tcp port 7050
  server->onClient(&handleNewClient, server);
  server->begin();
}

void loop() {
  DNS.processNextRequest();
}

I would normally ask at their github but it looks like its almost abandoned

Iv'e been looking in this file but i don't know what i'm doing really. I'm not sure how i could make any changes to help performance. Is ACK on by default?

Please if anyone is will to run this code on a few ESP8266'S . I have 3 clients and a server running but its just not fast enough. I'm not sure how to explain the effect im experiencing. It never crashes just freezes up for a while. PLEAAASEEEEEE..

It could be the libraries, or just the responsiveness of the servers.
Maybe adding some print()statements will help isolate where the delays are.