<< Back to Programming Forum   Search

Posts 1 - 8 of 8   
Unity: mobile/web: 2018-07-19 10:57:58


linberson 
Level 63
Report
Why is unity faster on my mobile phone than on my laptop?
Although my hardware is way better on my laptop than my mobile phone...
Unity: mobile/web: 2018-07-19 11:00:20


[NL] Goldtank 
Level 58
Report
mabye because of the optimization?

Warzone works atleast for me best on my laptop
Unity: mobile/web: 2018-07-19 11:49:54

(deleted) 
Level 63
Report
Unity runs faster as a standalone app rather than as browser WebGL. WebGL translates the code used in Unity (C#) to something that browsers understand (JavaScript). As JavaScript is interpreted, it's always going to be slower than languages that are compiled (such as C#).
Unity: mobile/web: 2018-07-19 14:49:10


linberson 
Level 63
Report
Gold, you are talking about the browser or the standalone?

So unity runs C# as standalone, mobile + laptop, and then webGL translates it to javascript and thats why its slower?
Unity: mobile/web: 2018-07-19 14:59:30

(deleted) 
Level 63
Report
^Yeah, that's why there's such a long initial loading time. Standalone only takes a few seconds to initially load. The only downside of the standalone is that it eats all my GPU.
Unity: mobile/web: 2018-07-19 17:46:53

Help
Level 58
Report
That may not be exactly true. I have been reading articles here and there because I am a NERD.

https://hacks.mozilla.org/2017/02/a-crash-course-in-just-in-time-jit-compilers/

Enjoy !!!1




https://en.wikipedia.org/wiki/JIT_spraying




Smalltalk (c. 1983) pioneered new aspects of JIT compilations. For example, translation to machine code was done on demand, and the result was cached for later use. When memory became scarce, the system would delete some of this code and regenerate it when it was needed again.[2][17] Sun's Self language improved these techniques extensively and was at one point the fastest Smalltalk system in the world; achieving up to half the speed of optimized C[18] but with a fully object-oriented language.

Wikipedia.




http://www.what-could-possibly-go-wrong.com/il2cpp/

https://en.wikipedia.org/wiki/Reflection_(computer_programming)




IL2CPP is Unity Technology that is there for some platforms and can work on iOS. The Mono is a library for .NET maintained by Microsoft. The way that a .NET works is that there will mostly always be some small part of JIT involved. The rest of the code would be fully compiled.

Pretty much everything nowadays is not fully compiled. The JIT code for .NET uses something code that is half compiled. Somewhere around the symbols part.




Unity is not exactly fully compiled like FLASH is in some way. Pretty much any decompiler can decompile Unity and Flash very accurately and at the same time. You get the variable, class names and the comments.


You cannot exactly say that Unity is native compile. And it is MONO PC standalone.


https://www.alanzucconi.com/2015/09/02/a-practical-tutorial-to-hack-and-protect-unity-games/



All fully compiled code should be obfuscated by nature. And you are not supposed to get the variable and classes names back...




Javascript is basically like Flash. It is slow. With WebGL, there is a lot more conversions done in place, this is why it is less efficient.

There is also issues with garbage collection but it is probably partly due to coding practices. I have seen many developers blame WebGL for memory leaks while other DEVs have managed to do amazing WebGL with super smooth performance.
Unity: mobile/web: 2018-07-19 17:55:07

Fizzer 
Level 64

Warzone Creator
Report
Why is unity faster on my mobile phone than on my laptop? Although my hardware is way better on my laptop than my mobile phone...

It's crazy, right? I've looked into this a lot while trying to make it faster, and this question has led to many sleepless nights.

The issue is that Unity is written in C++. Your mobile phone will happily run C++, but your browser will only run Javascript. Therefore Unity has to use a tool called Emscripten which converts C++ to Javascript, but that adds a lot of overhead.

UJS gets around this by directly converting from C# javascript and bypassing the C++ step completely.
Unity: mobile/web: 2018-07-20 15:39:02


Sakata Gintoki
Level 58
Report
Is Flash version slower than earlier versions now?
Posts 1 - 8 of 8