RPG Maker Forums

What are the best ways to speed up the execution of code inside a string with eval()?

I know most people say that eval allows for serious code-breaking problems, but since i'm left with no alternative(new function('string') doesn't work here because of the lack of access to certain things) I need to gather as much information as I can on this.


I heard(and confirmed on tests) that adding a function before the string and then calling it(like this: "myfunction=function(){"+thestring+"}myfunction()" and then evall all that) speed ups by up to 4x the performance, but I still wonder if there's more I can do, since it's still 10x slower than executing it as normal code

Latest Threads

Latest Profile Posts

Day 9 of giveaways! 8 prizes today :D
He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.

Forum statistics

Threads
106,038
Messages
1,018,466
Members
137,821
Latest member
Capterson
Top