Re: Similar Function Elimination

2017-08-23 Thread Александр Гурьянов
> RollABall Sorry man! Looks like using sed s'/Module\["asm"\]/var asm/' and then run SFE will produce error. But, if I simply run SFE then it works. Great!)) Solved! > non-valid asm.js No it's other big project. I can confirm that Cocos2d works fine. Maybe I can share resulting js of this

Re: Similar Function Elimination

2017-08-23 Thread arnab choudhury
BTW for the RollABall build.asm.js, you don't have to modify the asm.js file any more before running SFE after taking commit 8e62700a102fe12a6b1ff73934e21ae127e7f6ac, just wanted to call this out explicitly. You should be able to directly run run_sfe.js on the file. On Wednesday, August 23,

Re: Similar Function Elimination

2017-08-23 Thread Александр Гурьянов
TypeError: asm.js type error: double is not a subtype of intish 2017-08-23 13:42 GMT+07:00 Александр Гурьянов : > Sorry, missed error line from prev message: > TypeError: asm.js type error: double is not a subtype of intish > > 2017-08-23 13:42 GMT+07:00 Александр Гурьянов

Re: Similar Function Elimination

2017-08-23 Thread Александр Гурьянов
Sorry, missed error line from prev message: TypeError: asm.js type error: double is not a subtype of intish 2017-08-23 13:42 GMT+07:00 Александр Гурьянов : > Without -g2 I have this error: > g[a+4>>2]=-$|0; > > In function: > function

Re: Similar Function Elimination

2017-08-23 Thread Александр Гурьянов
Hi. After your commit -g2 error gone. But my project does not work. I see black screen (no errors, just black screen). And this error: TypeError: asm.js type error: void incompatible with previous return of type f64 If I remove -g2 game works (but asm.js not). Btw, I trying to find how to

Re: Similar Function Elimination

2017-08-22 Thread arnab choudhury
Hello caiiycuk - the latest commit to the master branch fixes this issue. Please let me know if you see any issues. Thanks for the due diligence! Regards, Arnab On Tuesday, August

Re: Similar Function Elimination

2017-08-22 Thread arnab choudhury
Thanks for catching this caiiycuk - I can repro and will have a fix out shortly. Looks like a name-clash bug in the minified name generator SFE uses. On Tuesday, August 22, 2017 at 10:17:15 AM UTC-7, caiiiycuk wrote: > > While trying to reproduce asm.js error, I found another problem. SFE >

Re: Similar Function Elimination

2017-08-22 Thread arnab choudhury
Hello caiiycuk I just pushed an update to master - can you try pulling and trying on build.asm.js from your share? Thanks! -Arnab On Tuesday, August 22, 2017 at 10:37:41 AM UTC-7, caiiiycuk wrote: > > > So - replacing 'Module["asm"] =' with 'var asm =' in build.asm.js > followed by an

Re: Similar Function Elimination

2017-08-22 Thread Александр Гурьянов
> So - replacing 'Module["asm"] =' with 'var asm =' in build.asm.js followed by > an attempt to run SFE succeeds. I see the following reduction (around 8%). Hmm, no luck. Do you build Roll-a-ball with unity or you use my archive. I tried you soultion on my build and it's does not work. Steps:

Re: Similar Function Elimination

2017-08-22 Thread Александр Гурьянов
While trying to reproduce asm.js error, I found another problem. SFE wan't work with -g2 flag, you can reporduce this problem with latest emscripten: ./emcc -O2 -g2 -s USE_COCOS2D=3 -s ASM_JS=1 --std=c++11 ./tests/cocos2d_hello.cpp --preload-file

Re: Similar Function Elimination

2017-08-22 Thread arnab choudhury
So - replacing 'Module["asm"] =' with 'var asm =' in build.asm.js followed by an attempt to run SFE succeeds. I see the following reduction (around 8%). 08/22/2017 09:15 AM19,782,571 build.asm.js 08/22/2017 09:39 AM18,225,058 build.asm.reduced.js I think the core problem

Re: Similar Function Elimination

2017-08-22 Thread Александр Гурьянов
Great. I will try to reproduce asm.js bug. Btw, if you build roll-a-ball project in Unity, then output will be in Unity format (also js, but with Unity loader, Unity staff). You can find emscripten output in Project/Library/webgl_cache/linkresult_asm/ folder. 2017-08-22 23:15 GMT+07:00 arnab

Re: Similar Function Elimination

2017-08-22 Thread arnab choudhury
Hi caiiycuk I'll have an update here shortly. I would love to be able to reproduce the non-asm.js bug since we have extensive tests for this at Tableau. I'm trying out the roll-a-ball project right now, will get back shortly. Regards, Arnab On Tuesday, August 22, 2017 at 3:07:44 AM UTC-7,

Re: Similar Function Elimination

2017-08-22 Thread Александр Гурьянов
As I see using SFE breaks asm.js validity? On my another project sfe produce js less on 500Kb (from 6.5Mb), but FF says: TypeError: asm.js type error: double is not a subtype of intish 2017-08-22 11:33 GMT+07:00 Александр Гурьянов : > Roll a ball project:

Re: Similar Function Elimination

2017-08-21 Thread Александр Гурьянов
Roll a ball project: https://www.assetstore.unity3d.com/en/#!/content/77198 2017-08-22 11:32 GMT+07:00 Александр Гурьянов : > Hi. I tried to use SFE on Roll-a-ball demo project, and get same > results. Unity uses --separate-asm flag to build asm.js. Resulting js > looks like:

Re: Similar Function Elimination

2017-08-21 Thread Александр Гурьянов
Hi. I tried to use SFE on Roll-a-ball demo project, and get same results. Unity uses --separate-asm flag to build asm.js. Resulting js looks like: Module["asm"] = (function(global,env,buffer) { "use asm";var a=new global.Int8Array(buffer);var b=new global.Int16Array(buffer);... I tried to remove

Re: Similar Function Elimination

2017-08-21 Thread Александр Гурьянов
I think that error can be reporudced on any Unity project, I will check and back) Btw, thanks for nice stuff! 2017-08-22 1:27 GMT+07:00 arnab choudhury : > Thanks Alon :). > > Caiiycuk, is the codebase you are trying to run SFE on available publicly? > Can you post the

Re: Similar Function Elimination

2017-08-21 Thread Alon Zakai
Very interesting stuff here! :) I opened this issue for implementation in Binaryen: https://github.com/WebAssembly/binaryen/issues/1142 On Fri, Aug 18, 2017 at 8:24 AM, arnab choudhury wrote: > Hello Emscripten-Discuss > > I just wanted to bring folks' attention to a new

Re: Similar Function Elimination

2017-08-21 Thread arnab choudhury
Hello Caiiycuk This may be because there might be some code wrapping the asm.js. I'll try building UnityJS and get back to you. You currently have to run SFE separately after all optimizations and it has not been integrated into Emscripten (although if there is enough demand, we can consider

Re: Similar Function Elimination

2017-08-21 Thread Александр Гурьянов
I tried this algorithm on Unity project, and I have this error: /home/caiiiycuk/sdk/Similar-Function-Elimination/src/similar_function_eliminator.js:156 var asmAstBody = this.asmAst.body; ^ TypeError: Cannot read property 'body' of undefined at

Re: Similar Function Elimination

2017-08-19 Thread Александр Гурьянов
Hi guys! Sorry, I don't understand from now SFE step is builtin into emscripten, or I should use it as post step after compilation? I want to try it on my projects. 2017-08-19 22:12 GMT+07:00 Charles Vaughn : > The biggest difference is SFE uses helper functions, since we need

Re: Similar Function Elimination

2017-08-19 Thread Charles Vaughn
The biggest difference is SFE uses helper functions, since we need to deal with finding pointers. It would be possible to generalize DFE and add a specific optimization to elide helpers but we haven't done that. -- You received this message because you are subscribed to the Google Groups

Re: Similar Function Elimination

2017-08-18 Thread arnab choudhury
Hey Floh This document covers Similar Function Elimination in detail. It is a more general version of DFE. The main difference between the two is that while in DFE we hash function

Re: Similar Function Elimination

2017-08-18 Thread Floh
Nice to see progress in that area :) What are the differences to the existing DFE pass? Since both are from you guys I guess the Similar Function Elimination is an improvement over the Duplicate Function Elimination? Is the new SFE supposed to replace DFE, or are they independent from each