Guild icon
DDraceNetwork
Development / developer
Development discussion. Logged to https://ddnet.tw/irclogs/ Connected with DDNet's IRC channel, Matrix room and GitHub repositories — IRC: #ddnet on Quakenet | Matrix: #ddnet-developer:matrix.org GitHub: https://github.com/ddnet
Between 2020-05-02 00:00:00Z and 2020-05-03 00:00:00Z
Avatar
I think you're setting the wrong targets
00:00
I'm sure I can find a branch like this in the handcoded assembly game rct2, for example
00:00
which is an example for very good performance
Avatar
if they need the branch, then it's fine
Avatar
I'm sure I'll find unneeded branches in there
00:01
e.g. reducing the number of syscalls, that's a lot better target
00:01
these cost actual time
00:01
especially with spectre/etc. fixes
Avatar
Ofc they are more significant
00:03
this is all beside the point though, it's only a single branch insruction in the silly no-op translation "table"
Avatar
yes, but I find it ridiculous that you claim that that branch matters
00:04
I agree that adding a translation table is not worth it for no benefit
00:04
but claiming that a branch there matters, is absurd IMO
Avatar
depends on how you define "matters"
Avatar
matters for software performance
00:04
for making your software run faster on a '95 computer
Avatar
that branch instruction will cost you a couple cycles, and it will have no gain, I don't see how anyone can argue that that is fine
00:06
If there was any value gain, fine there is nothing to argue, the branch is insignificant
Avatar
say the gain is that I want every client id to be 0
00:06
that is the only reason
00:06
even then it's completely insignificant
Avatar
if you need that, sure branch away
Avatar
I can't state enough wishes of that form to make it matter
00:07
it's just that I find cid=0 aesthetically more pleasing
00:07
even this very discussion probably used up more cycles than the branch in my hypothetical tw server 😛
00:07
by broadcasting it to many people, etc. etc.
00:08
so in a sense, arguing about that branch made performance worse already
Avatar
I don't get the point of this, every decision you make comes with a cost and a reward, you try to maximize reward and minimize cost
Avatar
except that you have a meta optimizer there, too
00:10
that makes you not care about details that don't matter
00:10
otherwise you'd spend too much time optimizing things that don't matter
00:10
as a matter of fact, this optimizer just called, sorry
Avatar
Premature optimization is not a good idea, sure. Not being cognisant of the performance implications of your code is worse imho
00:16
in context of teeworlds we have the luxury of being lax with our code because we have many cycles to spare before the performance becomes an issue to players
00:17
can't apply the same attitude working with high performance software where you want to squeeze out as much performance as you can nor can you apply it to embedded programming where you don't have performance to throw out the window
00:20
branch mispredictions and cache misses have non zero cost, they don't matter much for something like teeworlds that lies in the middle of the spectrum, that doesn't mean we should shove a loop that branches a million times in the middle of the main loop
Avatar
I agree with your previous messages
Avatar
anyway this is a tangent, I don't think we should decouple the clients understanding of the gameworld from the servers
Avatar
Having a seperate set of clients for dummy and main is just like having another client as dummy
00:24
it just makes sense imo (for 0.7, in 0.6 it is automatically due to snaps)
Avatar
if you think clients shouldn't be receiving the same set of clients, yes, that is the correct approach
Avatar
for mods you can never kniw
00:25
know*
Avatar
I also still believe the player info belonged in the snap
Avatar
Me too
Avatar
apparently the new skin system made the snap a bit larger
Avatar
Is it so much bigger?
Avatar
idk, I never checked it
Avatar
guess a few new entries is not too bad
Avatar
still, delta compression should be dropping the entire playerinfo
Avatar
wym?
Avatar
we don't always send complete snapshots
00:32
most of them are diffs called deltashots
Avatar
Why?
Avatar
because it'd be a huge amount of traffic to keep sending entire snapshots?
Avatar
Oh yea true
Avatar
I'm very sleepy, I have an upset stomach so I can't sleep
00:36
so annoying
Avatar
You need to enable the python language server in vscode to get proper intellisense...
Avatar
not microsofts one, that one doesn't want to do type inference
12:34
you need to enable the jedi one
12:38
also protip: if any of you wants a windows 10 virtual machine, go for a windows 7 one instead it performs much smoother under virtualization
👍 1
12:38
if you have to get a windows 10 one, boot the vm headless and RDP into the machine instead, microsofts rdp works better then all 3 virtualization platforms I tried
👍 1
12:39
(their native display adapters that is)
Avatar
can you rdp from linux?
Avatar
hm, didn't test it from linux, macOS has an official client, so does iOS, I think linux has a couple unofficial alternatives that perform well but I can't vouch for those
Avatar
Is there a tool better then bors? If not I'm thinking of doing https://github.com/bors-ng/bors-ng/issues/185
Consider the situation where: Pull requests are built the same way as staging/trying. The tests pass on a pull request. The pull request has master as an ancestor. There is nothing else in bors&amp...
Avatar
@Learath2 if you find a better tool, let me know
Avatar
hm, I really expected more from pythons functional programming interfaces, you can't even easily chain
14:46
Java and javascript both handle this beautifully
Avatar
itertools.chain?
Avatar
chain as in chain higher order functions like filter, map, reduce
Avatar
maybe I don't know what chain is
14:52
do you mean flatten?
Avatar
list.stream().map(m -> sin(m)).filter(m -> m > 0).collect(toList()) is what it'd look like in Java
14:53
list.map(m => sin(m)).filter(m => m > 0) in js
Avatar
[sin(m) for m in list if sin(m) > 0] pythonic
Avatar
list(filter(lambda m: m > 0, list(map(lambda m: sin(m))) in python
14:54
ofc I can use a list comprehension, my complaint was about the higher order functions filter, map and reduce
Avatar
hm
14:55
I guess python's stance on this is: use comprehensions instead of higher order functions?
Avatar
hm, if that is your stance about something in your language, I don't think it belongs in the language
Avatar
list comprehensions have some problems
Avatar
I was thinking that list comprehensions are equivalent in functionality
14:58
yes, lambdas are too verbose for other things in python
Avatar
I'm pretty sure they are
15:01
well javascript lacks it but java and rust have lazy evaluation for their streams and iterables respectively
Avatar
put it in paranthesis in python to achieve that
Avatar
put what in parenthesis?
Avatar
the list comprehension
Avatar
(for x in a)
Avatar
(sin(a) for a in iterable)
Avatar
hm, hadn't seen that before, that's useful
Avatar
this makes a generator iirc
Avatar
yes
Avatar
fwiw I prefer the chained calls to the list comprehension syntax, it's just easier on the eyes imho
15:07
I guess one could argue that pythons list comprehensions are "easier" to read as it's basically english
15:07
oh and list comprehensions are just awkward to type
15:10
Overall, I think if I wanted a language that lacks a type system, I think I'd use javascript nowadays
15:10
Next up on the docket of things to try is perl
Avatar
js has its weird things but its good
15:11
i use typescript if i can tho
Avatar
I also go for ts for any project that's getting deployed
Avatar
also the way it seamlessly connects with html when using react, jsx tsx
15:11
i love it
Avatar
observables and promises aren't half bad constructs for doing asynchronous work too
15:19
nim's futures are also cool
15:20
maybe I can take a look at Go, it's supposed to be great for concurrency
Avatar
tee keep crying now when you hold fire while frozen
15:44
is that wanted behavior?
Avatar
no
Avatar
lol, how did that happen? 😄
Avatar
the same commit as before, I guess
16:03
the same PR
Avatar
idk what "as before" refers to in this context
16:04
also do you know of a python equivalent for an assignment in an if stmt?
Avatar
or if let in rust
Avatar
they implemented the "walrus operator" recently
16:05
if m := re.match("abc", "abc"): (edited)
Avatar
it's >= 3.8 sadly
Avatar
ah
Avatar
too recent
Avatar
other than that, not aware of any
Avatar
is the idiom really m = re.match() if m is not None:?
Avatar
yes
16:06
or if m: also works
Avatar
this language was made by the scope leak gang 🙂
Avatar
there is only¹ function scope in python anyway
Avatar
yeah, needs more scoping
16:07
scopes are nice to avoid bugs, like types
Avatar
yep
16:07
try messing with lambdas and captured variables
16:07
that's horrible in python
16:08
return [lambda: i for i in range(10)]
16:08
gives you a nice list of ten functions returning 9
Avatar
wait what?
Avatar
the "fix" for that is: return [lambda i=i: i for i in range(10)], which is even worse
Avatar
who decides the direction of python now that the BDFL is gone?
Avatar
the community, probably? I don't know
16:14
ah look, JS has the very same problem
16:14
var array = 0; for (var i = 0; i < 10; i++) { array.push(function() { return i; }); }
16:14
gives you a list of ten functions returning 10
16:16
how to fix it in JS?
Avatar
you want a list of 10 functions returning from 0 to 9?
Avatar
yes
Avatar
let arr = []; for(let i = 0; i < 10; i++) arr.push(() => i);
16:30
(arrow functions (lambdas) have lexical scope)
Avatar
so the fix is replacing function() { return ...; } with () => ...?
16:32
or () => { return ...; } if you prefer
16:35
hm, I don't get why the initial python example doesn't work
Avatar
because it captures the variable i which changes later on
16:37
why does the JS example not work with functions but with lambdas?
16:37
or "what is lexical scope?"
16:37
and "what scope do function()s have?"
Avatar
now that I've read it again, I don't think the scope was the issue here
16:42
ah an anonymous function would work too, it's scope creep
16:43
it's let i instead of var i that's fixing it
Avatar
@heinrich5991 with let the scope of i is constrained to what's inside the loop body, at each iteration you get a new i, and the new anonymous function you create forms a closure around that new instance of i
16:50
with var it's scope is not limited at all so it suffers from the same issue with python
Avatar
ah
Avatar
js is such a minefield
16:59
but with ES6 we now have better control over scope (like let)
Avatar
I looked through the latest changes in the server code, and made some updates to the prediction with it. This includes the hammer-out-of-freeze server fix and a small fix for stopper prediction. Also cleaned up some code, and fixed predicted smoke-trails slightly so they don't go through walls in certain cases.
Exported 167 message(s)