#jsmess 2017-12-04,Mon

↑back Search ←Prev date Next date→ Show only urls(Click on time to select a line by its url)

WhoWhatWhen
SketchCow"It's a testing page for the "setTimeout, exit early, and then busywait" idea. You need to do a surprisingly long busywait to have a good chance of being accurate." [00:01]
***A_Scanner has joined #jsmess [00:08]
binji has quit IRC (Leaving) [00:16]
......... (idle for 43mn)
chartreus has quit IRC (Remote host closed the connection)
chartreus has joined #jsmess
[00:59]
cairnsh has joined #jsmess [01:05]
cairnshHi! I made this testing thing: https://skeletonplanet.com/test/timeout_tester.html#explanation
Sorry, without the fragment identifier
https://skeletonplanet.com/test/timeout_tester.html
I don't know if it works, it's pretty weird
It tests the method where you do a setTimeout for a shorter interval and then finish with a busywait.
I notice that the results are hugely different depending on the time interval, on this browser (Firefox Quantum 57.0 64-bit on Windows 8.1)
Timeout of 15 ms works great, with all but 13% of calls happening within 1 ms of the scheduled time, but timeout of 20 ms is a lot worse, with 38% off by more than 1 ms and 15% off by more than 6 ms
on the other hand, on this other browser (Opera 49.0) 15 ms is not a good time...
Wow, and if I run them on two different browsers at the same time they affect each other's behavior
:v
Well, ok, that's not so surprising
What's surprising is that the stats got BETTER when the other browser was doing its thing and WORSE when it was closed
so I guess I have no idea what's going on
[01:08]
baiyeah, that's the fun part :D
setTimeout isn't really a particularly accurate method unfortunately
[01:25]
***chartreus has quit IRC (Read error: Operation timed out) [01:27]
cairnshwhat's super interesting to me is that there are some intervals that are more accurate than others
and that it's different depending on the browser?
and possibly on your environment
maybe if you searched through the parameters for a good interval when you started, you could get something very accurate?
although it looks like the good parameters can also change depending on the other programs that are running
[01:27]
baiyeah, and probably varies wildly depending on the other stuff your app is doing as well
on the other hand, requestAnimationFrame fires pretty regularly every 16.6667ms, unless you're pushing more work than you can handle per frame, then the time between calls goes up proportionally
[01:35]
***chartreus has joined #jsmess [01:37]
baiso I don't think we really need setTimeout as it can be wildly unpredictable, and can instead just rely on the fact that requestAnimationFrame will be called in the next (16.6667 - timeTakenByThisFrame) ms [01:37]
someone had a suggestion to use setjmp/longjmp to pause and resume the context in the sleep function, so if you're asked to sleep for more than the number of ms that would take you into the next 16.6667ms block, you basically set a jump point and allow control to return to the browser, then on the next requestAnimationFrame handler we longjmp() back to that stored context, so we resume inside of the sleep
function, which now says "oh, I now only have .2ms left to sleep"
[01:45]
***binji has joined #jsmess
i0npulse has quit IRC (Ping timeout: 248 seconds)
Rai-chan has quit IRC (Ping timeout: 248 seconds)
[01:49]
............... (idle for 1h10mn)
cairnshthat works well for me but the percentage of time spent busywaiting varies a lot
well, under my specific browser under my special circumstances
actually, that's only if I busywait until 17 ms has passed, which you wouldn't be doing. waiting 16.67 ms is fine. never mind
[03:00]
.... (idle for 15mn)
SketchCowcairnsh: Are you comfortable jumping in with code?
Or test casing is what you prefer
[03:17]
cairnshI will take a shot at it! I don't have an Emscripten installation yet. [03:19]
But I have a Linux machine that I can install it on. (I don't need a VM inside that, right?) [03:27]
......... (idle for 42mn)
What would you want me to do? [04:09]
....... (idle for 33mn)
***A_Scanner has quit IRC (Leaving)
chartreus has quit IRC (Read error: Operation timed out)
[04:42]
SketchCowWell, make this happen. :) But any insights into approach are welcome.
Bai could do it if he focused exclusively on it, but his start-up needs to make money
[04:54]
....... (idle for 32mn)
baiwell, this has been productive in terms of suggestions people have made
I think there were two main realizations both from typing it out like this and from suggestions made by others....the setjmp/longjmp part is a missing piece to what I was doing before, and then after talking through the problem and looking moe closely at the profiling graphs, I think there's really only one main source of all that sleeping
[05:26]
***balrog has quit IRC (Read error: Operation timed out) [05:37]
balrog has joined #jsmess [05:42]
.... (idle for 15mn)
SketchCowI'll just keep throwing you people until it looks like the beginning of Matrix:Reloaded
https://i.makeagif.com/media/6-24-2015/0wQta0.gif
[05:57]
........... (idle for 50mn)
***Rai-chan has joined #jsmess
i0npulse has joined #jsmess
[06:48]
.... (idle for 16mn)
Vito` has joined #jsmess [07:07]
Vito`huhn
I think IRCCloud died like 2+ weeks ago but reported it was still connected
[07:08]
.......... (idle for 47mn)
SketchCowYou missed EVERYTHING
Microsoft bought us for $3bil
I paid $1bil to have Notch... "upgraded"
[07:55]
Vito`worth it [07:56]
SketchCow$75 million firepit
We posted a thing you'll like
https://t.co/cEesFk0mPm
[08:01]
Vito`I saw, great to put it all in one place [08:06]
....... (idle for 32mn)
SketchCowYeah, let's bust this thing wide open! [08:38]
........ (idle for 36mn)
***chartreus has joined #jsmess [09:14]
...... (idle for 25mn)
chartreus has quit IRC (Read error: Operation timed out) [09:39]
...... (idle for 28mn)
binji has quit IRC (Read error: Operation timed out) [10:07]
........................................................... (idle for 4h54mn)
cairnsh has quit IRC (Quit: Leaving) [15:01]
cola_ has joined #jsmess
cola_ is now known as cairnsh
[15:06]
cairnshHi again, sorry
Can I ask some stupid questions?
I guess that's more of a rhetorical question, ok here goes
Emscripten seems to do something like compile the C program to assembly language and then convert the assembly language instructions into Javascript. Is that really necessary??
[15:06]
SketchCow:)
Yes
You mean asm.js?
[15:15]
***cairnsh has left Leaving
cairnsh has joined #jsmess
[15:16]
SketchCow(ASM.JS isn't assembly language) [15:16]
cairnshwhoops, sorry
I mean, when I run emcc tests/hello_world.c -o hello.html, it produces a Javascript file that looks like
I don't know, here's the main function:
function _main() {
var $0 = 0, $vararg_buffer = 0, label = 0, sp = 0;
sp = STACKTOP;
STACKTOP = STACKTOP + 16|0; if((STACKTOP|0) >= (STACK_MAX|0)) abortStackOverflow(16|0);
$vararg_buffer = sp;
$0 = 0;
(_printf(384,$vararg_buffer)|0);
STACKTOP = sp;return 0;
}
[15:16]
SketchCowI don't know at what level you want me to cover this.
A lot of Emscripten is dealing with something that should never have had to happen, now happening
[15:19]
DFJustinemscripten compiles the C program to a bytecode called LLVM and then converts that into an assembly-like subject of javascript called asm.js
asm.js is valid normal javascript but browsers that are expecting it can quickly compile it back into something closer to machine language before executing it
[15:22]
cairnshOh! Okay. [15:23]
DFJustinit's cheesy and that's why WebAssembly was invented
to be a proper solution
[15:23]
cairnshThank you. [15:24]
SketchCowBut we support the old way, for a while to come. [15:35]
......... (idle for 41mn)
***Lord_Nigh has quit IRC (Read error: Operation timed out) [16:16]
.......... (idle for 45mn)
Lord_Nigh has joined #jsmess [17:01]
................................................................. (idle for 5h24mn)
SketchCowI like the suggestions
We're getting a LOT of people visiting the page.
A LOT.
I wonder how many are bots. They try and comment, and it's sometimes garbagy
[22:25]

↑back Search ←Prev date Next date→ Show only urls(Click on time to select a line by its url)