My Roblox Game is too unoptimized. How can i do?

Hello, i want to create Windows 11.

I wanted to create 1 to 98% of the Windows 11 System and approx PC System like Bios…

All things are going good but i have a problem.

I use a external lua loadstring that executes like explorer.exe and stuff…

So for the lag i have added a spawn function for multi-threading.

And i use promise to have the dll (library) result and for exe i spawn but just return a signal and when the signal connected the program has finished his work.

Since i use spawn now it’s crazy laggy.
All of my animations like window are now non-existent.

How can i multi-threading, more fluid my game?

Setup of my PC:
AMD Ryzen 5
GTX 1600x
16 GB
Roblox Studio consumed RAM: 2024MB

Footage of my work:

How many guis/scripts/loops your game has?

Don’t know but i have 2 gui are running. (two window in the video)