jsfuck icon indicating copy to clipboard operation
jsfuck copied to clipboard

Number handling change

Open GreatGameGal opened this issue 4 years ago • 3 comments

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

GreatGameGal avatar Oct 20 '20 09:10 GreatGameGal

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?

aemkei avatar Oct 20 '20 09:10 aemkei

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 !+

GreatGameGal avatar Oct 20 '20 09:10 GreatGameGal

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?

aemkei avatar Oct 20 '20 11:10 aemkei