End Update datapack help!

Sup guys , im currently working on a end dimension overhaul datapack and got some serious complications. Firstly I got demotivated by the fact that a datapack named "Stellarity" which also updates the end causes a ton of lag and weirdness (I used
4gb ram server) still lag , so here's my question.
** How do make custom world generation with the least lag?**

Bonus:- It's a huge project so if someone with good datapack making skills can talk to me in dms then it'll be great , thanks in advance :))

Continue to help post