From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.13.223.8 with SMTP id i8mr7237899ywe.44.1459399640041; Wed, 30 Mar 2016 21:47:20 -0700 (PDT) X-Received: by 10.157.11.167 with SMTP id 36mr147790oth.17.1459399639972; Wed, 30 Mar 2016 21:47:19 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!peer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!y89no10204764qge.0!news-out.google.com!ha2ni191igb.0!nntp.google.com!sy18no319486igc.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 30 Mar 2016 21:47:19 -0700 (PDT) In-Reply-To: <8f3d3515-aa1a-4d7c-b465-3ad25c902ae5@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2601:191:8201:bb5a:a53e:470:132b:de52; posting-account=fdRd8woAAADTIlxCu9FgvDrUK4wPzvy3 NNTP-Posting-Host: 2601:191:8201:bb5a:a53e:470:132b:de52 References: <8f3d3515-aa1a-4d7c-b465-3ad25c902ae5@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <2fa7a9d8-57c6-4a9f-a81f-7f341da17cb8@googlegroups.com> Subject: Re: Roundtrip latency problem using Gnoga, on Linux, when testing at localhost address From: rieachus@comcast.net Injection-Date: Thu, 31 Mar 2016 04:47:20 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 2745 X-Received-Body-CRC: 450504513 Xref: news.eternal-september.org comp.lang.ada:29928 Date: 2016-03-30T21:47:19-07:00 List-Id: On Wednesday, March 30, 2016 at 11:35:59 AM UTC-4, Olivier Henley wrote: > Hey, >=20 > I am trying a small multiplayer 2d game using Gnoga and Phaser.io and and= I > am experiencing some 80 ms for any roundtrip test when trying my game at > 127.0.0.1:8080. I profiled javascript and it looks like it take 0.4 ms on > the client side to process round_trip(). >=20 > Anyone has an idea about what is wrong? =20 What is the (real) tick for the clock you are using? Some OS clocks have a= bout a 20 ms tick, and if you call them twice will return previous tick plu= s 1 millisecond or even one microsecond. Other system clocks will delay u= ntil the next tick. Some software depends on unique time-stamps, so the sy= stem clock gets diddled one way or the other. Oh, the other thing that can happen is that there is a clock buried in the = tasking/threading/process switching software, and interprocess messages onl= y get delivered when that clock ticks, or waiting software only gets starte= d every so many ticks. (The idea is to insure that threads have enough time= to actually do something before someone with higher priority grabs the sys= tem back. All this cruft is still buried in OS software, even though most = systems have more than one CPU...) I suspect that one or the other of these is going on, due to the 2 to 3 rat= io between the two results. I remember fighting these gremlins years ago w= hen trying to time various message passing protocols.=20