aemkei / jsfuck

Write any JavaScript with 6 Characters: []()!+
jsfuck.com
Do What The F*ck You Want To Public License
8.07k stars 671 forks source link

Number handling change #112

Closed GreatGameGal closed 6 months ago

GreatGameGal commented 3 years ago

Changes how numbers are handled to decrease amount of code in compiler & increase performance of compiled code dramatically.

aemkei commented 3 years ago

Thanks for the suggestion. Looks really interesting! But unfortunately the size will increase.

Do you have any numbers how the performance improves? Is it the "compile" or the "execute" performance?

GreatGameGal commented 3 years ago

I know the execution of compiled code will increase in performance. I believe the time spent adding numbers to mapping will be slightly faster too, though it's inconsequential. You could remove the changes to 0, leaving 0 as "+[]" to remove any size changes as "!![]+!![]" is the same number of characters as "!+[]+!+[]"

For performance difference numbers on !! vs !+

aemkei commented 3 years ago

But does the performance during execution really matter in our case? When will we reach a limit where the code will block a thread for some time?