14 ms·
So far, even on underpowered Android phones I've tested on, the performance has been really good. It's more of a testament to how fast SCIP is than anything els
by jstrieb 2y ago
So far, even on underpowered Android phones I've tested on, the performance has been really good. It's more of a testament to how fast SCIP is than anything else!
Specifically, I haven't been able to find a reasonable set of parameters that cause the optimization to take longer than ~20 seconds on the slowest device I tried.
To get things to be smooth, though, I had to do debouncing and also run optimization in a web worker (separate, non-blocking thread) so the UI doesn't hang. Doing that was its own challenge since web workers don't use the HTTP cache for security reasons (they're supposed to be an isolated context), and it was re-requesting the ~5MB WASM files every time any of the numbers was adjusted. To solve this I used a service worker with a local cache.
Slow performance of web-based Z3 for optimization was one of the main reasons I switched to SCIP. I originally had a version working using a WASM port of Z3, but it just wasn't fast enough to be usable.
- jvanderbot 2y agoMakes sense. SCIP has been really fast for me. Good to hear it's working for you! Did you do some local-vs-phone tests? I'm really curious how 20s on android compares to laptop.
- jstrieb 2y agoMost optimization calls on my laptop happen nearly instantaneously, whereas they can take a few seconds on average on phones. Didn't test super comprehensively. If you end up wanting to use the version of SCIP compiled to WASM, I have it pre-compiled in the repo here: https://github.com/jstrieb/poker-chipper/tree/fab41bbe8821d0c49d074716271727564c1457f1/src/compiled https://github.com/jstrieb/poker-chipper/tree/fab41bbe8821d0... To interact with WASM SCIP, I use the CLI with an Emscripten virtual filesystem (as opposed to the C API/FFI): https://github.com/jstrieb/poker-chipper/blob/fab41bbe8821d0c49d074716271727564c1457f1/src/solve.js#L222-L247 https://github.com/jstrieb/poker-chipper/blob/fab41bbe8821d0... If you want to compile it yourself, the code and compiler flags I used to do that are documented in a Dockerfile in the repo: https://github.com/jstrieb/poker-chipper/blob/fab41bbe8821d0c49d074716271727564c1457f1/experiments/Dockerfile https://github.com/jstrieb/poker-chipper/blob/fab41bbe8821d0...