Jump to content

Best way to hide JavaScript code?


user123
 Share

Recommended Posts

Hi @SolarJS

 

I do not wish to publish a jsperf of my code, for the same reason I am using JScrambler.

 

But I've looked into the jsperf you posted and applied Ignore Code Blocks to it.

Here is the result: http://jsperf.com/jscrambler/6

 

ScreenShot2015-01-05at143953_zps4648fda2

 

 

I think the results are pretty self-explanatory. You can avoid the high performance hit if you know the code and you spend a few minutes instrumenting JScrambler not to hurt performance.

But I think its up to everyone to judge and to see for themselves using their own code, as each code is a different story.

 

You don't need to use big fonts in red to make yourself heard. There is certainly room for different opinions. Mine, yours, and others that may come.

Link to comment
Share on other sites

It does (although I didn't set up the test, just found it). As each user who waits for a game. Do you know the google statics that each additional 1s in loading / waiting hurts you revenue? And decoding produces GC and glitches, so you changed the test to, well, non-real-life application. And if i would really want to do a comparison, i would have used the original unchanged code and do not change it to match my expectations.

Link to comment
Share on other sites

Well, I think that is a matter of opinion. 

 

To sum it up (as I don't wish to make this an endless discussion) 

  - JScrambler is the best protection for JS I know about. It offers way more obfuscation than other tools.

  - Like anything that uses obfuscation, it's not bullet proof and it may hurt performance. Unlike other tools, JScrambler allow you to tweak the way it transforms your code (using Ignore Code Blocks), and reduce the performance hit to acceptable levels (see http://jsperf.com/jscrambler/6)

  - It's quite ok to spend a few extra ms (well under a second) in the initial loading, and in exchange get the best protection I can to minimize the chance our code is hacked.

  - If performance is everything, and you can't waste any cpu cycles, then don't get protection. Instead, use a minifier/optimizer like closure or uglifyjs. The risk is higher.

 

These are my 2 cents.

Link to comment
Share on other sites

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...