cmake detection of upstream or fastcomp backend

2019-10-30 Thread caiiiycuk
Hi. Is it possible to detect if cmake is runned for fastcomp or upstream backend, need it for switch between asyncify and emterpreter. I checked CMAKE_C_COMPILER_VERSION and EMSCRIPEN_VERSION both does not contain such information. Thanks -- You received this message because you are subscribed

undefined symbol: __wasi_fd_* on latest-fastcomp

2019-10-29 Thread caiiiycuk
Hi! Recently I updated dosbox to compile both on fastcomp+emterpreter and upstream+asyncify. upstream+asyncify version is default now, but I want to have option to use fastcomp+empterpreter. Now when I try to build fastcomp version I have this errors: warning: undefined symbol: __wasi_fd_close w

Re: -s ASYNCIFY, dosbox

2019-08-05 Thread caiiiycuk
Just want to summarize everything after adding WHITELIST support: Ubuntu 19.04 / Chrome 72.0.3626.121 O3: DEFAULT2.0Mb 60 FPS / 22 FPS EMTERPRETIFY 2.2Mb 60 FPS / 40 - 50 FPS ASYNCIFY 3.0Mb 44-55 FPS / 11 - 4

Re: Startup still seems slow, even with WASM

2018-04-08 Thread caiiiycuk
Test case: https://github.com/kripken/emscripten/pull/6419#issuecomment-379610702 -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsub

Running custom optimizations over emmited bc

2018-03-26 Thread caiiiycuk
Good day! I am playing with llvm optimizer and I trying to setup build process that allows me to run custom optimizations over bc. I want to: 1. Build resulting .bc of game (using llvm-link) 2. Transform this .bc with custom optimizations 3. Produce .js with emcc For (1) I compile all source file

asm.js size overhead

2017-10-17 Thread caiiiycuk
Hi. Beacuse of google-chrome bug, and some other reasons I can't use asm.js in my scripts. Currently I just replace "use asm"; to ""; For my case is very important to reduce js size as much as possible. If I revert all asm.js stuff (type declarations and etc.) to plain js, how do you think how

Re: js-dos wan't work in chrome

2017-10-03 Thread caiiiycuk
The problem is inside em-dosbox, it allow main loop to work only for one second, but new chrome can't work so fast. I increase the time limit to 10 sec. Now it's work. Thanks! -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscri

js-dos wan't work in chrome

2017-10-01 Thread caiiiycuk
Hi guys. Maybe you know I have a site with hosted emdosbox. I maintain compiled version of emdosbox called js-dos.js and now all games that works before not work in chrome. I have user reports about this problem, games work in all other browsers. I write there not in v8 tracker because I don't

Re: Very slow init time in new chrome 61.0.3163.100

2017-09-27 Thread caiiiycuk
I have make a test case, and fill issue. https://bugs.chromium.org/p/chromium/issues/detail?id=769607 -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to emsc

Re: Very slow init time in new chrome 61.0.3163.100

2017-09-27 Thread caiiiycuk
This function is very big, as I understand it's a C++ static initializer. res.cpp is a file that initialize all game resouces and it contains much of global variables. I don't understand why in asm.js it takes so much time, it's a chrome bug or I can fix it in someway? -- You received this mes

Re: Very slow init time in new chrome 61.0.3163.100

2017-09-27 Thread caiiiycuk
Rapid update, after enabling -g2 I saw that inside 'func', function called '__GLOBAL__sub_I_res_cpp' takes 100% of total time in asm.js mode -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving

Very slow init time in new chrome 61.0.3163.100

2017-09-27 Thread caiiiycuk
Hi. I found strange problem after updating to latest chrome. In past my game works great, but now loading time (callMain time) in chrome is near 12 sec (on mobile up to 90sec). I profile the game and found that only one function take this time, this function called 'func'. Self Time | Total Ti

asm.js very slow compile time

2017-08-09 Thread caiiiycuk
Hi. I use Firefox 54.0 to test my game that I compile from C++ to js. Js size is 6.3Mb, when I open game in FF, then it compiles asm.js for very long time: Successfully compiled asm.js code (total compilation time 55703ms; stored in cache) As you see I wait one minute before game starts, all o

Re: PRECISE_F32=1 for part of code

2017-08-01 Thread caiiiycuk
I think I found another way, I wrote uglifyjs script that remove Math_fround from everywhere except list of functions. This script just find calls to Math_fround and replace it with callee argument. Looks like this solution work. What do you think, is it correct? P.S. box2d function that produc

PRECISE_F32=1 for part of code

2017-07-27 Thread caiiiycuk
Hi. Is it possible to enable precies float computation for a part of code. I use box2d and it works incorrect in PRECISE_F32=0 mode. For each frame native version makes 1-5 physics steps, but js version makes 100-200 steps. But if I set PRECISE_F32=1 then both versions works identically. I guess

Minify explanation

2017-07-23 Thread caiiiycuk
Hi. I need some explanation about minify stage of native optimizer. I know that when I use at least O2 flag all function names are mangled (minified). Also I know that -g1 or -profiling-funcs permits name mangling. But in this case result js file is much bigger. I wonder why there are no option

--llvm-opts 2 optimization bug. (incoming)

2017-07-11 Thread caiiiycuk
Hi. I've working on big game based on cocos2d engine. I think that I found optimization bug, but I can't found test case yet. When I try to extract problem code to new project it's works. I think that bug is not in game, because I've checked all memory access with vallgrind and it's ok, moreover

emterpreter clarification

2017-04-20 Thread caiiiycuk
Hi guys. I've working on project that uses while loops to render animation and to receive user input, like this: for (int i = 0; ihttps://groups.google.com/d/optout.

cocos2d: function pointer casts

2017-04-05 Thread caiiiycuk
Hi! Cocos2d use special macro to cast different function pointers to universal handler format: typedef void (Object::*SEL_MenuHandler)(Object*); > #define menu_selector(_SELECTOR) (cocos2d::SEL_MenuHandler)(&_SELECTOR) With this *menu_selector* macro I can cast many different function signatur

Memory leak in generated code

2017-03-23 Thread caiiiycuk
Hi! I've porting another game on cocos2d with emscripten, and for js version game hangs after two levels with out of memory error. memoryprofiler output: I can easily repr

Re: Regal GL

2017-01-26 Thread caiiiycuk
Ok, I found where problem is. Regal should be compiled to emscripten with special options, I use this command: emmake make -f Makefile SYSTEM=emscripten After that, in lib folder of Regal you can find static libs for emscripten. This libs contains rgl* methods that replace original opengl api.

Re: Regal GL

2017-01-25 Thread caiiiycuk
* I can`t understand how I can disable built in opengl support. -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsubscr...@googlegroup

Regal GL

2017-01-25 Thread caiiiycuk
Hi! I want to try build project against regal gl. I does not found any success story how to do this. I successfully build project against Regal in native environment. After that I compile regal with emscripten without any problem. So, for now I have static libraries libRegalGLUT.a libRegallib.a.

Re: Progressive performance loss while execution of script

2016-11-17 Thread caiiiycuk
PerSize to 2). So this "tempBuffers" helps only for beginning of script execution. четверг, 10 ноября 2016 г., 0:30:12 UTC+3 пользователь caiiiycuk написал: > > Hi! I am working on porting a game into js. The game is well tested, and > works fine in native code. Compiled

Re: Progressive performance loss while execution of script

2016-11-16 Thread caiiiycuk
Hi, Alon. I have new details about progressive slowness in my game. We testing game on Iphone 5s iOS 10.1.1. v4. The profiler is very ugly, and crash after 2-3 seconds of game. The game starts very fast 50-60fps. After some time, fps slow down to 17-18. BUT, If I change tab in safari and then r

Progressive performance loss while execution of script

2016-11-09 Thread caiiiycuk
Hi! I am working on porting a game into js. The game is well tested, and works fine in native code. Compiled js version also works but js version has progressive performance loss. While I goes from one level to another the game works slower. Native version does not have this effect. When I relo

Re: Error on compile

2016-11-08 Thread caiiiycuk
compiler should not crash. среда, 9 ноября 2016 г., 1:28:25 UTC+3 пользователь caiiiycuk написал: > > Hi! The emscripten compiler throw error while compiling my project: > > #0 0x00de4738 llvm::sys::PrintStackTrace(llvm::raw_ostream&) > (/home/caiiiycuk/emscripten/sdk/

Error on compile

2016-11-08 Thread caiiiycuk
Hi! The emscripten compiler throw error while compiling my project: #0 0x00de4738 llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/home/caiiiycuk/emscripten/sdk/emscripten-fastcomp/build/bin/llc+0xde4738) #1 0x00de4e16 SignalHandler(int) (/home/caiiiycuk/emscripten

Re: PGO alternatives for fastcomp

2016-10-31 Thread caiiiycuk
I want to implement PGO on js-optimizer step. But it hard to understand format of AST, is there are some docs about it? Currently I try to simply call PGO_INVOKE(1) in beginning of each function: function pgo(ast) { var PATCHED_FUNCS = set(); traverseGeneratedFunctions(ast, function(func) {

Re: PGO alternatives for fastcomp

2016-10-27 Thread caiiiycuk
-20161028T023927.cpuprofile Is it useful? or I can just write extractor from profiler results and generate intersections with all functions from emscripten output, and then use this intersection in DEAD_FUNCTIONS среда, 26 октября 2016 г., 1:54:32 UTC+3 пользователь caiiiycuk написал: > >

PGO alternatives for fastcomp

2016-10-25 Thread caiiiycuk
Hi! i want to find dead functions like in PGO mode. But I saw that PGO is not supported, is there are replacement for this mode in fastcomp? -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving

Compiler flags for compile and linker stage

2016-10-25 Thread caiiiycuk
Hi! As said in section "Building projects": >> In order to properly optimize code, it is important to use the same optimization flags and other compiler options when compiling source to object code, and object code to JavaScript (or HTML). Is it really true? I think that many flags are work only

Mix_Init

2016-10-20 Thread caiiiycuk
Hi, why Mix_Init returns MIX_INIT_OGG? ``` Mix_Init: function(flags) { if (!flags) return 0; return 8; /* MIX_INIT_OGG */ }, ``` As I know SDL_mixer implemented through sound tag, so it can support mp3 and wav. Actually I use SDL_mixer to play mp3 files. -- You received this messag

Re: var _rand=undefined;

2016-10-16 Thread caiiiycuk
App crashes at this line: var _rand=undefined;function _arc4random() { return _rand.apply(null, arguments) // THIS LINE } понедельник, 17 октября 2016 г., 0:11:15 UTC+3 пользователь caiiiycuk написал: > > Hi! I compile another big project with emscripten. Looks like all works

var _rand=undefined;

2016-10-16 Thread caiiiycuk
Hi! I compile another big project with emscripten. Looks like all works fine, except _rand function. In emscripten js output i see this code: Line ~7000 var _rand=undefined;function _arc4random() { return _rand.apply(null, arguments) } Line ~70 function _rand() { ... } When js app star

cocos2d as emscripten-port

2016-08-19 Thread caiiiycuk
Hi! I have worked version of Cocos2d on latest emscripten branch (I can run samplegame, much of test, etc.) I want to add cocos2d as library port, so how I can add it to emscripten-ports repo? -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" gr

GLUT mouseEvents

2016-08-16 Thread caiiiycuk
Hi! I use latest emscripten (incoming) and i have a trouble. My app works fine in FF, but on Chrome, Android, and WP10 my app doesn`t handle any mouse/touch events. Code of library_glut.js: var isTouchDevice = 'ontouchstart' in document.documentElement; window.addEventListener("keydown",

SAFE_HEAP

2016-08-08 Thread caiiiycuk
Hi! I try to update old emscripten branch of cocos2d to work with latest emscripten. And for now i can run sample projects of cocos2d with latest emscripten. But i have problem with SAFE_HEAP, if i set SAFE_HEAP=1 then sample game throws segfault. I can`t see anything intresting in stacktrace,

Re: em++ linking is broken

2016-08-05 Thread caiiiycuk
Looks like -O1 helps me to. пятница, 5 августа 2016 г., 1:13:06 UTC+3 пользователь caiiiycuk написал: > > Hi. I trying to build cocos2d with emscripten. For now i can compile the > framework with emscripten, but linking is broken. If i run simple project > then error occured:

It is possible to tune browser for better performance?

2015-02-04 Thread caiiiycuk
Hi! I have a nice application that compiled to js with emscripten. I want to distribute it as a windows application. I can pack html+js into application with node-webkit or in some other way. Does firefox or chrome have non standard compilation flags that can boost emscripten-js performance? I

functions array vs switch/case (performance)

2015-01-18 Thread caiiiycuk
Hi. I have a question about performance. I have a very long switch/case block, like this: ``` switch (instruction) { case 0: f1(); break; case 1: f2(); break; case 2: f3(); break; // ... case n: fn(); break; } ``` I can replace this switch/case with functions array, like this: ``` funa

50 dos games are ported to browser with em-sandbox

2014-12-31 Thread caiiiycuk
I found very intresting project em-dosbox . The project is a port of DosBOX to JavaScript. I built 50 dos games to they js versions with em-sandbox. Visit js-dos.com and have fun. Happy new year! -- You received this message because you are subscribed

Re: Branch updates and Emterpreter landing

2014-10-20 Thread caiiiycuk
Hi Alon. Can i use emterpreter to avoid problems related to infinite loops. For example i have game that mostly emscripten ready, but some functions contains infinite loops that can't be easily rewritten. void infinite() { while (true) { // ... while (true) { // .. if (

Re: blitSurface (library_sdl.js) throws exception in firefox and works in chrome

2014-10-09 Thread caiiiycuk
https://github.com/kripken/emscripten/pull/2879 -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsubscr...@googlegroups.com. For more o

blitSurface (library_sdl.js) throws exception in firefox and works in chrome

2014-10-08 Thread caiiiycuk
|| Linux caiiiycuk-desktop 3.13.0-36-generic #63-Ubuntu SMP Wed Sep 3 21:30:07 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux Firefox: 32.0.3 Chrome: 37.0.2062.120 (64-bit) -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from

Prefomance tips. Passing big data to javascript.

2014-07-31 Thread caiiiycuk
Hi. I have 3d engine that compiled with emscripten. This engine take models from binary data and then render it. Render cycle looks like: loadModels(uint8_t* data, size_t len); eachFrame -> render(); I want to query data from web server. What is the best way to pass binary data to c++ code. For

Re: ASM error: missing definition of function _em_midi_play

2014-03-31 Thread caiiiycuk
Also this functions added to IGNORED_FUNCTIONS list in settings.js -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsubscr...@googlegro

ASM error: missing definition of function _em_midi_play

2014-03-31 Thread caiiiycuk
Hi. I declare some functions in native code, but implement it in JS. Like this: #ifdef EMSCRIPTEN #include extern "C" { extern void em_midi_volume(byte); extern void em_midi_play(const char*); extern bool em_midi_is_playing(); extern voidem_midi_stop(); } #endif This functions impl

build system type changed

2014-03-24 Thread caiiiycuk
Hi! After updating to latest incoming i have issue with autotools, when i run emconfigure i have this log: /home/caiiiycuk/em-sandbox/emscripten/emconfigure ttd-emscripten/configure --without-libtimidity --without-allegro --without-cocoa --without-zlib --without-liblzma --without-liblzo2

Re: [asm.js] TypeError: asm.js type error: intish is not a subtype of int

2014-02-14 Thread caiiiycuk
https://github.com/kripken/emscripten/issues/2120 -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsubscr...@googlegroups.com. For more

[asm.js] TypeError: asm.js type error: intish is not a subtype of int

2014-02-13 Thread caiiiycuk
After compiling opendune in FF i have message: TypeError: asm.js type error: intish is not a subtype of int All works, but what does it mean? -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receivin