00:04 <+bridge> [ddnet] ASAN maps 20TB 😄 00:04 <+bridge> [ddnet] i think most java stuff also maps around 100GB 00:32 <+bridge> [ddnet] I wonder what they do with it in discord. ASan uses it as a very clever trick 00:34 <+bridge> [ddnet] @heinrich5991 is the update simple at all? I need to review a file soon-ish 00:34 <+bridge> [ddnet] yes, update is simple 00:34 <+bridge> [ddnet] probably 00:34 <+bridge> [ddnet] can do it later 00:35 <+bridge> [ddnet] basically just patch out the check, I think 00:45 <+bridge> [ddnet] does anyone know an ipv4 range that would basically allow anyone to join? its for a tw server 00:45 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/1044398207700050021/image.png 00:45 <+bridge> [ddnet] 0.0.0.0-255.255.255.255 01:45 <+bridge> [ddnet] After you get through the mess that is setting all this up with 0 documentation, podman actually works quite well 01:47 <+bridge> [ddnet] Also definitely worth it to set it up with netavark instead of the old cni-plugins 04:24 <+bridge> [ddnet] <- Mahdiyar> @WarHammer i send command in terminal 05:47 <+bridge> [ddnet] Rustaceans: after learning the syntax, rust is easier to read than python!! 05:47 <+bridge> [ddnet] Meanwhile rust: 05:47 <+bridge> [ddnet] Data cleaning 05:47 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/1044474191761637426/IMG_20221122_064557_473.jpg 07:51 <+bridge> [ddnet] Ok I put it on my CV thanks 07:51 <+bridge> [ddnet] (@Not Keks) 07:57 <+bridge> [ddnet] This is a snippet shared on twitter purposely obscure btw 07:58 <+bridge> [ddnet] Its explained on rust reddit some time ago 07:58 <+bridge> [ddnet] it looks like its staring at you 07:58 <+bridge> [ddnet] | _ | 07:59 <+bridge> [ddnet] _ is saying, i have to pattern match this variable, but i wont use it 07:59 <+bridge> [ddnet] In this case 07:59 <+bridge> [ddnet] woag 10:23 <+bridge> [ddnet] http://www.cs.cmu.edu/~sprite/main4.html 11:03 <+bridge> [ddnet] If you wanna see some truly horrendous rust, you need to look at traits. I've seen some almost compete with C++ std types 11:12 <+bridge> [ddnet] C can be rly obfuscated too 11:12 <+bridge> [ddnet] U can do art 11:13 <+bridge> [ddnet] IOCCC 11:13 <+bridge> [ddnet] Also if i run the code from the img to the formatter u can see it clearer 11:13 <+bridge> [ddnet] Its formatted in a way to make it look like its all closures 11:14 <+bridge> [ddnet] But its just OR pattern matching 11:14 <+bridge> [ddnet] U can have | a | b 11:14 <+bridge> [ddnet] The first | is valid 11:14 <+bridge> [ddnet] Cuz it allows to writte macros easier 11:14 <+bridge> [ddnet] That use this 11:14 <+bridge> [ddnet] Its the same as a | b 11:15 <+bridge> [ddnet] How does this get formatted anyway? 11:15 <+bridge> [ddnet] Probs some spaces between the OR 11:15 <+bridge> [ddnet] And if u run check u prob get some warns 11:18 <+bridge> [ddnet] as said 11:18 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/1044557433089044561/image.png 11:18 <+bridge> [ddnet] this is how it gets formatted 11:18 <+bridge> [ddnet] and 11:18 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/1044557499350650930/image.png 11:19 <+bridge> [ddnet] btw 11:19 <+bridge> [ddnet] x is a closure 11:19 <+bridge> [ddnet] and the .. 11:19 <+bridge> [ddnet] is an empty Range 11:19 <+bridge> [ddnet] so u are passing an empty range that gets ignored 11:19 <+bridge> [ddnet] x(..) 11:19 <+bridge> [ddnet] Ah it does remove all the useless | 11:20 <+bridge> [ddnet] yeah 11:20 <+bridge> [ddnet] well idk if .. is an empty range or an infinite 11:20 <+bridge> [ddnet] Yeah, that does fix it up a fair bit 11:21 <+bridge> [ddnet] https://www.reddit.com/r/rust/comments/ynkblf/mara_bos_this_code_compiles_and_runs_without/ 11:21 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/1044558166437920808/image.png 12:15 <+bridge> [ddnet] ```sql 12:15 <+bridge> [ddnet] SELECT Map as map, Name as name, Time as time, Ranking as rank, Timestamp as timestamp, Server as server, ((time - PrevTime) / PrevTime) * 100 as faster_percent 12:15 <+bridge> [ddnet] FROM ( 12:15 <+bridge> [ddnet] SELECT RANK() OVER w AS Ranking, MIN(Time) AS Time, Name, Timestamp, Server, LEAD(Time) OVER w as PrevTime, Map 12:15 <+bridge> [ddnet] FROM race 12:15 <+bridge> [ddnet] GROUP BY Map, Name 12:15 <+bridge> [ddnet] WINDOW w AS (PARTITION BY Map ORDER BY MIN(Time)) 12:15 <+bridge> [ddnet] ) as a 12:15 <+bridge> [ddnet] WHERE Name = "Ryozuki" 12:16 <+bridge> [ddnet] ORDER BY Ranking ASC;``` 12:16 <+bridge> [ddnet] is have this query 12:16 <+bridge> [ddnet] but my ranks are a bit less, like by 3-6 ranks 12:16 <+bridge> [ddnet] on some maps 12:16 <+bridge> [ddnet] as shown on the website 12:16 <+bridge> [ddnet] i wonder if im wrong or the web is wrong 12:16 <+bridge> [ddnet] Quite proud of coming up with this 12:16 <+bridge> [ddnet] Learning window functions ftw 12:31 <+bridge> [ddnet] This query is criminally slow 12:31 <+bridge> [ddnet] 90s 12:33 <+bridge> [ddnet] You can put an explain in front to see the execution plan 12:34 <+bridge> [ddnet] I probs dont have proper indexes for this query 12:34 <+bridge> [ddnet] Since sqlite doesnt have any when importing it 12:34 <+Ryozuki> create unique index mapinfo_map_idx on mapinfo(Map); 12:34 <+Ryozuki> create unique index maps_map_idx on maps(Map); 12:34 <+Ryozuki> create index maps_timestamp_idx on maps(Timestamp); 12:34 <+Ryozuki> create index race_map_idx on race(Map); 12:34 <+Ryozuki> create index race_time_idx on race(Time); 12:34 <+Ryozuki> create index teamrace_map_idx on teamrace(Map); 12:34 <+Ryozuki> create index teamrace_time_idx on teamrace(Time); 12:34 <+Ryozuki> i got these 12:36 <+bridge> [ddnet] I probs need a index on name 12:36 <+bridge> [ddnet] For ranks xd 12:36 <+bridge> [ddnet] I'm not good enough to look at a complex nested query like the one above and really guess what index is required 12:37 <+bridge> [ddnet] I'd also try name, but I'd probably also look at explain before 😄 12:38 <+bridge> [ddnet] I never used explain 12:38 <+bridge> [ddnet] Will see 12:39 <+bridge> [ddnet] After i test it with the name idx 12:45 <+Ryozuki> https://pastebin.mozilla.org/rbZQmcPd/raw 12:45 <+Ryozuki> time to interpret this 12:45 <+Ryozuki> never rly did explains before 12:45 <+Ryozuki> index didnt help 12:45 <+Ryozuki> i even added a composite index 12:45 <+Ryozuki> map name 12:55 <+bridge> [ddnet] Oh 12:55 <+bridge> [ddnet] 42 seconds 12:56 <+bridge> [ddnet] Using rust release 12:56 <+bridge> [ddnet] So there is some overhead on my side and not just sqlite 12:57 <+bridge> [ddnet] 38~s on sqlite3 13:03 <+bridge> [ddnet] Still quite a long time, though it is kinda understandable 13:04 <+bridge> [ddnet] There are quite lot of ranks 13:04 <+bridge> [ddnet] So idk whats a good time 13:04 <+bridge> [ddnet] Yeah the table is massive 13:05 <+bridge> [ddnet] Essentially my query has to run over all ranks to determine the rank of the player 13:05 <+bridge> [ddnet] This is the query for the player page 13:06 <+bridge> [ddnet] (We do cache these for a reason :D) 13:06 <+bridge> [ddnet] Can you do an `EXPLAIN QUERY PLAN` instead of flat explain? 13:06 <+bridge> [ddnet] Sqlite print's individual opcodes with just explain which is annoying to read 13:07 <+bridge> [ddnet] s\/\'// 13:08 <+bridge> [ddnet] Ah ok 13:09 <+bridge> [ddnet] ``` 13:09 <+bridge> [ddnet] QUERY PLAN 13:09 <+bridge> [ddnet] |--CO-ROUTINE a 13:09 <+bridge> [ddnet] | |--CO-ROUTINE (subquery-3) 13:10 <+bridge> [ddnet] | | |--CO-ROUTINE (subquery-4) 13:10 <+bridge> [ddnet] | | | |--SCAN race USING INDEX teamrace_map_name_idx 13:10 <+bridge> [ddnet] | | | `--USE TEMP B-TREE FOR ORDER BY 13:10 <+bridge> [ddnet] | | `--SCAN (subquery-4) 13:10 <+bridge> [ddnet] | `--SCAN (subquery-3) 13:10 <+bridge> [ddnet] |--SCAN a 13:10 <+bridge> [ddnet] |--SEARCH m USING INDEX maps_map_idx (Map=?) LEFT-JOIN 13:10 <+bridge> [ddnet] `--USE TEMP B-TREE FOR ORDER BY 13:10 <+bridge> [ddnet] ``` 13:10 <+bridge> [ddnet] the query: 13:10 <+bridge> [ddnet] ```sql 13:10 <+bridge> [ddnet] SELECT a.Map as map, Name as name, Time as time, Ranking as rank, a.Timestamp as timestamp, a.Server as rank_server, m.Server as map_server, 13:10 <+bridge> [ddnet] ((time - PrevTime) / PrevTime) * 100 as faster_percent, m.Points as points, m.Stars as stars 13:10 <+bridge> [ddnet] FROM ( 13:10 <+bridge> [ddnet] SELECT RANK() OVER w AS Ranking, MIN(Time) AS Time, Name, Timestamp, Server, LEAD(Time) OVER w as PrevTime, Map 13:10 <+bridge> [ddnet] FROM race 13:10 <+bridge> [ddnet] GROUP BY Map, Name 13:10 <+bridge> [ddnet] WINDOW w AS (PARTITION BY Map ORDER BY MIN(Time)) 13:10 <+bridge> [ddnet] ) as a 13:10 <+bridge> [ddnet] 13:10 <+bridge> [ddnet] LEFT JOIN maps m ON m.Map = a.Map 13:10 <+bridge> [ddnet] WHERE Name = "Ryozuki" 13:10 <+bridge> [ddnet] ORDER BY Ranking ASC; 13:10 <+bridge> [ddnet] ``` 13:10 <+bridge> [ddnet] I guess temp trees are missed index opportunities 13:11 <+bridge> [ddnet] Lol i think that i misnamed a index 13:11 <+bridge> [ddnet] But well shouldnt matter 13:12 <+bridge> [ddnet] Teamrace -> race 13:12 <+bridge> [ddnet] Its using the composite index i made 13:12 <+bridge> [ddnet] Hm, can you try an index on Time maybe? 13:12 <+bridge> [ddnet] I think i have one 13:13 <+bridge> [ddnet] But ill do that after i go eat xd 13:13 <+bridge> [ddnet] Oh, I think the group by there might make an index on time not work actually 13:39 <+bridge> [ddnet] How to turn on vulkan by console argument? 13:39 <+bridge> [ddnet] How to turn ON vulkan by console argument? 13:39 <+bridge> [ddnet] `./DDNet "gfx_backend vulkan"` 13:43 <+bridge> [ddnet] Ty 15:29 <+Ryozuki> i found a small optimization with a where clause 15:29 <+Ryozuki> 6 seconds ~~ 15:29 <+Ryozuki> i think it depends on how many different maps u finished 15:52 <+bridge> [ddnet] What is your sql supposed to show 15:57 <+bridge> [ddnet] There are currently 18M ranks 15:57 <+bridge> [ddnet] All the best ranks a player has on all maps they finishes 15:58 <+bridge> [ddnet] Aka the ddnet player page 15:58 <+bridge> [ddnet] Its actually faster to calculate all at once 15:58 <+bridge> [ddnet] Im gonna do this and keep it in memory, ordering by player name and building a manual index 17:06 <+bridge> [ddnet] is it possible for mods to have prediction if it can't replicate ddnet physics in some way 17:10 <+bridge> [ddnet] This is a client id bug that happens when you have strong and a lower client id than the person in freeze. chatting probably fixes it by changing the order of inputs. It could also be fixed by changing the order you join the server(which is why you say it worked fine yesterday). Cool thing though, this makes it so doing this with hammer isnt reliant on client id. Before you could only get height from hammering someone in freeze with w 17:10 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/1044646045956706354/weak_hammer.demo.mp4 17:24 <+bridge> [ddnet] Keeping all calculated ranks in memory takes 1.6gb 17:24 <+bridge> [ddnet] Not bad 17:24 <+bridge> [ddnet] There are 10M non repeated player ranks 17:25 <+bridge> [ddnet] 18M if counting repeated 17:25 <+bridge> [ddnet] @Ryozuki either the sqlite is wrong or website you are right xd 17:25 <+bridge> [ddnet] I think it only respects second 17:25 <+bridge> [ddnet] Not milliseconds 17:25 <+bridge> [ddnet] Ah 17:25 <+bridge> [ddnet] Wdym about seconds 17:26 <+bridge> [ddnet] Oknvm 17:26 <+bridge> [ddnet] Xd 17:26 <+bridge> [ddnet] Teamranks are also always ranks right? 17:30 <+bridge> [ddnet] Ye 17:30 <+bridge> [ddnet] If u finish in team it saves a teamrank and rank 17:33 <+bridge> [ddnet] @Ryozuki so how fast is your sql 17:33 <+bridge> [ddnet] When I'm at home i want to beat 17:35 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/1044652430895362090/20221122_112550.jpg 17:35 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/1044652431277051924/20221122_111220.jpg 17:35 <+bridge> [ddnet] Awesome job 17:36 <+bridge> [ddnet] Montblanc 17:36 <+Ryozuki> my current sql returns all ranks with their calculated rank numbers and a bit more info like % of improvement over previous rank 17:36 <+Ryozuki> and number of finishes on same map 17:36 <+bridge> [ddnet] Previous rank or previous run of a completely unrelated player xd 17:37 <+bridge> [ddnet] ```sql 17:37 <+bridge> [ddnet] SELECT a.Map as map, Name as name, Time as time, Ranking as rank, a.Timestamp as timestamp, a.Server as rank_server, m.Server as map_server, 17:37 <+bridge> [ddnet] ((time - PrevTime) / PrevTime) * 100 as faster_percent, m.Points as points, m.Stars as stars, finishes 17:37 <+bridge> [ddnet] FROM ( 17:37 <+bridge> [ddnet] SELECT RANK() OVER w AS Ranking, MIN(Time) AS Time, Name, Timestamp, Server, LEAD(Time) OVER w as PrevTime, Map, COUNT(*) as finishes 17:37 <+bridge> [ddnet] FROM race 17:37 <+bridge> [ddnet] GROUP BY Map, Name 17:37 <+bridge> [ddnet] WINDOW w AS (PARTITION BY Map ORDER BY MIN(Time)) 17:37 <+bridge> [ddnet] ) as a 17:37 <+bridge> [ddnet] LEFT JOIN maps m ON m.Map = a.Map 17:37 <+bridge> [ddnet] ORDER BY Name; 17:37 <+bridge> [ddnet] ``` 17:37 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/1044652780159258754/image.png 17:37 <+bridge> [ddnet] i find this looks kinda odd 17:37 <+bridge> [ddnet] different player 17:38 <+bridge> [ddnet] How is that useful lol 17:41 <+bridge> [ddnet] ?? 17:41 <+bridge> [ddnet] To see the rank inprovement 17:41 <+bridge> [ddnet] Its the same shown in #records 17:41 <+bridge> [ddnet] Ah but that's only for top rank 17:42 <+bridge> [ddnet] No 17:42 <+bridge> [ddnet] Its for each 17:42 <+bridge> [ddnet] Vs previous 17:42 <+bridge> [ddnet] Thats what LAG window function does 17:42 <+bridge> [ddnet] I mean in record 17:42 <+bridge> [ddnet] LEAD* 17:42 <+bridge> [ddnet] Ah ye 17:43 <+bridge> [ddnet] What if u last place xd 17:43 <+bridge> [ddnet] NaN 17:50 <+bridge> [ddnet] 0 iirc 17:50 <+bridge> [ddnet] Or ye 17:52 <+bridge> [ddnet] hey where can i find the logs file please ? 17:59 <+Ryozuki> im only doing the data fetching part for now so the website couldnt be uglier but here are my ranks https://ddstats.org/players/Ryozuki 17:59 <+Ryozuki> (it will look nothing a like when finished) 18:00 <+Ryozuki> also got some maps in case ur curious https://ddstats.org/maps 18:04 <+bridge> [ddnet] Unlike the ddnet web this actually lists all ranks! So u may find ur name in the map page even if ur a nobo 18:04 <+bridge> [ddnet] :monkalaugh: 18:10 <+ChillerDragon> cool stuff ryo im fan 18:10 <+ChillerDragon> also wow did u buy a domain for that? 18:11 <+bridge> [ddnet] explain im stupid 18:11 <+ChillerDragon> i gotta say ryo i do enjoy your front ends they look so nice 18:11 <+ChillerDragon> im not even trolling 18:11 <+ChillerDragon> i enjoy this simple pornhub themed rank site 18:11 <+ChillerDragon> also your blogs etc very lit 18:14 <+ChillerDragon> yo btw @Ryozuki the ddnet category is a dead link here https://edgarluque.com/blog/chat-command-ddracenetwork/ 18:15 <+ChillerDragon> also when blog that explains how to write UI code in ddnet 18:16 <+bridge> [ddnet] Ddnet only shows top 500 18:16 <+bridge> [ddnet] Iirc 18:16 <+bridge> [ddnet] On a map 18:16 <+bridge> [ddnet] The ranks 18:16 <+bridge> [ddnet] ah 18:16 <+bridge> [ddnet] right 18:17 <+bridge> [ddnet] Ye chiller i bought it 18:17 <+bridge> [ddnet] I want to make the next ddnet website, and if it is not accepted ill just run it as some alternative stats web 18:18 <+bridge> [ddnet] Soon ill blog i guess 18:18 <+bridge> [ddnet] Been busy 18:19 <+ChillerDragon> such community driven ddnet much decentralized 18:19 <+ChillerDragon> pog 18:20 <+ChillerDragon> when add ranks to blockchain? 18:20 <+bridge> [ddnet] :PES3_WeirdSip: 18:22 <+bridge> [ddnet] So many ideas so little time 18:22 <+bridge> [ddnet] Gotta integrate teemasterparser 18:36 <+bridge> [ddnet] cool but weird at the same time 19:03 <+bridge> [ddnet] without order by my query runs in 32ms 19:03 <+bridge> [ddnet] 19:03 <+bridge> [ddnet] just adding the order by Ranking adds fucking 14 seconds 19:03 <+bridge> [ddnet] wtf is wrong with SQLite 19:03 <+bridge> [ddnet] we speak about 700 rows 19:08 <+bridge> [ddnet] @Ryozuki gimme ur results, first 10 entries or smth 19:08 <+bridge> [ddnet] i want to compare 19:09 <+bridge> [ddnet] without order by my query runs at 390ms with previous 19:09 <+bridge> [ddnet] Ofc order by is not cheap 19:09 <+bridge> [ddnet] yeah but bro, 700 entries 19:09 <+bridge> [ddnet] 14 seconds 19:09 <+bridge> [ddnet] never in life 19:09 <+bridge> [ddnet] over a integer 19:09 <+bridge> [ddnet] U only get 700? 19:09 <+bridge> [ddnet] 783 19:09 <+bridge> [ddnet] Im at the gym 19:09 <+bridge> [ddnet] rip 19:09 <+bridge> [ddnet] I get 10 million 19:09 <+bridge> [ddnet] wtf 19:09 <+bridge> [ddnet] how can u can 10 mios if there are only like 1000 maps on ddnet 19:10 <+bridge> [ddnet] Im talking about ranks lol 19:10 <+bridge> [ddnet] yeah i mean best ranks for Ryozuki 19:10 <+bridge> [ddnet] @Not Keks urs is slow cuz u probs didnt add indexes 19:10 <+bridge> [ddnet] i did 19:10 <+bridge> [ddnet] The sqlite db u download has indexes stripped 19:10 <+bridge> [ddnet] its only order by ranking 19:10 <+bridge> [ddnet] which is slow 19:12 <+bridge> [ddnet] It will be slow 19:12 <+bridge> [ddnet] nah bro 19:12 <+bridge> [ddnet] To get the ranking u gotta scan all ranks to know the poss 19:12 <+bridge> [ddnet] i can put them in memory (not sqlite) and do sorting my own 19:12 <+bridge> [ddnet] Pos 19:12 <+bridge> [ddnet] it will never take 14 seconds 19:12 <+bridge> [ddnet] Yeah 19:12 <+bridge> [ddnet] Idk 19:12 <+bridge> [ddnet] Im half doing that rn 19:12 <+bridge> [ddnet] this must be some weird optimization that sucks in this situation 19:13 <+bridge> [ddnet] Its prob a sql limitation 19:13 <+bridge> [ddnet] Rn i get all ranks sorted by player name 19:14 <+bridge> [ddnet] And i build a hashmap with each player name mapped to a start index and end index in the sorted array 19:14 <+bridge> [ddnet] i want to beat this sql ^ 19:14 <+bridge> [ddnet] its very slow tho 19:14 <+bridge> [ddnet] How much time it takes mine 19:14 <+bridge> [ddnet] Did u beat it 19:14 <+bridge> [ddnet] It is slow yeah 19:14 <+bridge> [ddnet] yeah mine takes 390m,s 19:14 <+bridge> [ddnet] without order by 19:14 <+bridge> [ddnet] with order by 14seconds xD 19:14 <+bridge> [ddnet] Which order by 19:14 <+bridge> [ddnet] but i have to verfify the prev time thing 19:15 <+bridge> [ddnet] ```sql 19:15 <+bridge> [ddnet] 19:15 <+bridge> [ddnet] select 19:15 <+bridge> [ddnet] x.best, 19:15 <+bridge> [ddnet] x.Map, 19:15 <+bridge> [ddnet] ( 19:15 <+bridge> [ddnet] select COUNT(*) + 1 as r from (select time from race r1 where r1.Map = x.Map and r1.time < x.best group by r1.name) 19:15 <+bridge> [ddnet] ) 19:15 <+bridge> [ddnet] as Ranking, 19:15 <+bridge> [ddnet] ( 19:15 <+bridge> [ddnet] x.best - ( 19:15 <+bridge> [ddnet] select time from race as r2 where r2.Map = x.Map and r2.Timestamp > x.Timestamp order by r2.Timestamp ASC LIMIT 1 19:15 <+bridge> [ddnet] ) 19:15 <+bridge> [ddnet] ) 19:15 <+bridge> [ddnet] / ( 19:15 <+bridge> [ddnet] select time from race as r2 where r2.Map = x.Map and r2.Timestamp > x.Timestamp order by r2.Timestamp ASC LIMIT 1 19:15 <+bridge> [ddnet] ) 19:15 <+bridge> [ddnet] as PreviousRank 19:15 <+bridge> [ddnet] from ( 19:15 <+bridge> [ddnet] select min(r.time) as best, Map, Timestamp from race r where name = "Ryozuki" group by map 19:15 <+bridge> [ddnet] ) as x 19:15 <+bridge> [ddnet] 19:15 <+bridge> [ddnet] --order by Ranking 19:15 <+bridge> [ddnet] ``` 19:15 <+bridge> [ddnet] as soon as i enable the last line 19:15 <+bridge> [ddnet] rip 19:15 <+bridge> [ddnet] The order by in window is needed 19:16 <+bridge> [ddnet] Ah ok 19:16 <+bridge> [ddnet] Hmm idi 19:16 <+bridge> [ddnet] Idk 19:16 <+bridge> [ddnet] Does it do the same correct 19:16 <+bridge> [ddnet] i dunno except for faster_percent it looks correct 19:16 <+bridge> [ddnet] tho i dont query map info 19:16 <+bridge> [ddnet] but that cant take long with indices 19:24 <+bridge> [ddnet] @Not Keks just to be sure r u showing the best time? 19:24 <+bridge> [ddnet] yes 19:24 <+bridge> [ddnet] Btw mine also shows finish count 19:25 <+bridge> [ddnet] yeah but tbh that shouldnt add lot of extra time 19:25 <+bridge> [ddnet] even i a completly seperate sub select 19:25 <+bridge> [ddnet] In theory window functions should be an improvement btw 19:25 <+bridge> [ddnet] Or so i read xd 19:25 <+bridge> [ddnet] maybe the query is simply inefficient 19:25 <+bridge> [ddnet] Ye im no expert 19:26 <+bridge> [ddnet] but the fact that order by completly destroys my query already makes me wonder if its simply a bug that ur query is so slow 19:26 <+bridge> [ddnet] would be interesting to know similar query in mariadb perf 19:27 <+bridge> [ddnet] Some order bys cant be optimized with an index 19:27 <+bridge> [ddnet] Cuz they use temporary values 19:27 <+bridge> [ddnet] yes 19:27 <+bridge> [ddnet] Like the rank 19:28 <+bridge> [ddnet] but in no world does sorting 700 elements take 14 seconds 19:28 <+bridge> [ddnet] Ye xd 19:28 <+bridge> [ddnet] But 19:28 <+bridge> [ddnet] Ur not sorting 700 19:28 <+bridge> [ddnet] Ur sorting 10m 19:28 <+bridge> [ddnet] And then picking 19:28 <+bridge> [ddnet] 700 19:28 <+bridge> [ddnet] no 19:28 <+bridge> [ddnet] i already tried to use an extra subselect 19:28 <+bridge> [ddnet] I have T-SQL code snippet and i wonder if i can do same things in my mariadb query 19:28 <+bridge> [ddnet] ```sql 19:28 <+bridge> [ddnet] declare @abc table (dat float) 19:28 <+bridge> [ddnet] insert @abc values(2),(3),(4) 19:28 <+bridge> [ddnet] 19:28 <+bridge> [ddnet] select max(dat) from @abc 19:28 <+bridge> [ddnet] ``` 19:28 <+bridge> [ddnet] or any workaround 19:29 <+bridge> [ddnet] U want to insert and return? 19:29 <+bridge> [ddnet] On postgresql u use the RETURNING clause 19:29 <+bridge> [ddnet] create temp table, insert values and use functions like avg max min with it 19:30 <+bridge> [ddnet] Make it all in a transaction or smth 19:30 <+bridge> [ddnet] Why would u do that 19:30 <+bridge> [ddnet] Just make a tbl 19:30 <+bridge> [ddnet] https://tenor.com/view/pepe-feels-weird-man-spin-gif-23391479 19:33 <+bridge> [ddnet] i mean, just wondering, i want to pass some values to a procedure and use avg min max with them 19:33 <+bridge> [ddnet] i mean, just wondering, i want to pass some values to my procedure and use avg min max with them 19:35 <+bridge> [ddnet] Just do 19:35 <+bridge> [ddnet] Select from 19:35 <+bridge> [ddnet] From accepts more than tables 19:40 <+bridge> [ddnet] now rewrite in rust. 19:40 <+bridge> [ddnet] I want to smthAvg(1,2,3,outVat); 19:40 <+bridge> [ddnet] And get 2 in outVat 19:40 <+bridge> [ddnet] But not just sum and divide 19:41 <+bridge> [ddnet] But make a virtual table and use avg() on it 19:41 <+bridge> [ddnet] Its just an example but shows the problem 19:41 <+bridge> [ddnet] Eh 19:41 <+bridge> [ddnet] Not home atm 19:41 <+bridge> [ddnet] Sounds like XY problem 19:42 <+bridge> [ddnet] U probs can do all thst in the procedure 19:42 <+bridge> [ddnet] Without a table 19:42 <+bridge> [ddnet] Sql itself already makes temp tables when needed 19:42 <+bridge> [ddnet] Ok 20:10 <+bridge> [ddnet] ```sql 20:10 <+bridge> [ddnet] SELECT 20:10 <+bridge> [ddnet] z.*, 20:10 <+bridge> [ddnet] ((z.best - z.prevranktime) / z.best) * 100 as prev 20:10 <+bridge> [ddnet] FROM 20:10 <+bridge> [ddnet] ( 20:11 <+bridge> [ddnet] select 20:11 <+bridge> [ddnet] y.best, 20:11 <+bridge> [ddnet] y.Map, 20:11 <+bridge> [ddnet] y.Ranking, 20:11 <+bridge> [ddnet] y.Timestamp, 20:11 <+bridge> [ddnet] ( 20:11 <+bridge> [ddnet] select 20:11 <+bridge> [ddnet] r4.Time 20:11 <+bridge> [ddnet] from 20:11 <+bridge> [ddnet] (select r3.Time, r3.Timestamp from race as r3 where r3.Map = y.Map order by r3.Timestamp DESC) as r4 20:11 <+bridge> [ddnet] where 20:11 <+bridge> [ddnet] r4.Timestamp < y.Timestamp LIMIT 1 20:11 <+bridge> [ddnet] ) as prevranktime 20:11 <+bridge> [ddnet] from 20:11 <+bridge> [ddnet] ( 20:11 <+bridge> [ddnet] select 20:11 <+bridge> [ddnet] x.best, 20:11 <+bridge> [ddnet] x.Map, 20:11 <+bridge> [ddnet] ( 20:11 <+bridge> [ddnet] select COUNT(*) + 1 as r from (select time from race r1 where r1.Map = x.Map and r1.time < x.best group by r1.name) 20:11 <+bridge> [ddnet] ) 20:11 <+bridge> [ddnet] as Ranking, 20:11 <+bridge> [ddnet] (select timestamp from race as r2 where r2.Map = x.Map and r2.Time = x.best and r2.name = "Ryozuki" LIMIT 1) as Timestamp 20:11 <+bridge> [ddnet] from ( 20:11 <+bridge> [ddnet] select min(r.time) as best, Map from race r where name = "Ryozuki" group by map 20:13 <+bridge> [ddnet] @Ryozuki if u had r4 20:13 <+bridge> [ddnet] 20:13 <+bridge> [ddnet] is it the prev time to whoever had r4 before your rank? 20:13 <+bridge> [ddnet] 20:13 <+bridge> [ddnet] or is it r4 if your finish wouldnt exists 20:13 <+bridge> [ddnet] 20:13 <+bridge> [ddnet] or simply the actual run before ur finish? 20:13 <+bridge> [ddnet] 20:13 <+bridge> [ddnet] its so magic to me xd 20:13 <+bridge> [ddnet] i mean records always takes whoever had r1 before 20:13 <+bridge> [ddnet] but it kinda seems weird to do that for other ranks, since they can change during time 20:14 <+bridge> [ddnet] anyway enough SQL for a month xd 20:18 <+bridge> [ddnet] xd 20:18 <+bridge> [ddnet] its the rank before yours 20:18 <+bridge> [ddnet] thats not yours 20:18 <+bridge> [ddnet] e.g you improved a % over the previous rank 20:18 <+bridge> [ddnet] its always just your previous rank 20:18 <+bridge> [ddnet] not relative to the first 20:20 <+bridge> [ddnet] so if u have r4, the time to r5? xd 20:23 <+bridge> [ddnet] ```sqlSELECT 20:23 <+bridge> [ddnet] z.*, 20:23 <+bridge> [ddnet] ((z.best - z.prevranktime) / z.best) * 100 as prev 20:23 <+bridge> [ddnet] FROM 20:23 <+bridge> [ddnet] ( 20:23 <+bridge> [ddnet] select 20:23 <+bridge> [ddnet] y.best, 20:23 <+bridge> [ddnet] y.Map, 20:23 <+bridge> [ddnet] y.Ranking, 20:23 <+bridge> [ddnet] y.Timestamp, 20:23 <+bridge> [ddnet] ( 20:23 <+bridge> [ddnet] select 20:23 <+bridge> [ddnet] r4.Time 20:23 <+bridge> [ddnet] from 20:23 <+bridge> [ddnet] (select r3.Time from race as r3 where r3.Map = y.Map order by r3.Time ASC) as r4 20:23 <+bridge> [ddnet] where 20:23 <+bridge> [ddnet] r4.Time > y.best LIMIT 1 20:23 <+bridge> [ddnet] ) as prevranktime 20:23 <+bridge> [ddnet] from 20:23 <+bridge> [ddnet] ( 20:23 <+bridge> [ddnet] select 20:23 <+bridge> [ddnet] x.best, 20:23 <+bridge> [ddnet] x.Map, 20:23 <+bridge> [ddnet] ( 20:23 <+bridge> [ddnet] select COUNT(*) + 1 as r from (select time from race r1 where r1.Map = x.Map and r1.time < x.best group by r1.name) 20:23 <+bridge> [ddnet] ) 20:23 <+bridge> [ddnet] as Ranking, 20:23 <+bridge> [ddnet] (select timestamp from race as r2 where r2.Map = x.Map and r2.Time = x.best and r2.name = "Ryozuki" LIMIT 1) as Timestamp 20:23 <+bridge> [ddnet] from ( 20:23 <+bridge> [ddnet] select min(r.time) as best, Map from race r where name = "Ryozuki" group by map 20:24 <+bridge> [ddnet] ) as x 20:24 <+bridge> [ddnet] ```sql 20:24 <+bridge> [ddnet] SELECT 20:24 <+bridge> [ddnet] z.*, 20:24 <+bridge> [ddnet] ((z.best - z.prevranktime) / z.best) * 100 as prev 20:24 <+bridge> [ddnet] FROM 20:24 <+bridge> [ddnet] ( 20:24 <+bridge> [ddnet] select 20:24 <+bridge> [ddnet] ok fixed it for that 20:24 <+bridge> [ddnet] for some reason it also only takes 48ms now xD 20:24 <+bridge> [ddnet] i only added a timestamp index, which i didnt use before so weird af 20:24 <+bridge> [ddnet] these are my indices, cant copy so soz for image 20:24 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/1044694992981082173/image.png 20:30 <+bridge> [ddnet] the % improvement over r5 20:30 <+bridge> [ddnet] u literally see my calc in the query 20:31 <+bridge> [ddnet] oh timestamp query 20:31 <+bridge> [ddnet] i dont think i have it 20:31 <+bridge> [ddnet] oh lol 20:31 <+bridge> [ddnet] you can have indices with ASC and desc 20:31 <+bridge> [ddnet] TIL 20:32 <+bridge> [ddnet] yeah i did that too now i think 20:32 <+bridge> [ddnet] i have the 5800x on my table 20:32 <+bridge> [ddnet] just gotta install it 20:32 <+bridge> [ddnet] i gotta beat my lazyness 20:32 <+bridge> [ddnet] 10 fps increase here i come 20:32 <+bridge> [ddnet] kek 20:33 <+bridge> [ddnet] i wonder how fast ddnets sql is 20:33 <+bridge> [ddnet] deen is SQL pro 20:33 <+bridge> [ddnet] nah but its probs matters a lot for compile times 20:33 <+bridge> [ddnet] and sql kek 20:33 <+bridge> [ddnet] xd 20:33 <+bridge> [ddnet] but faster compiling 20:33 <+bridge> [ddnet] is epic 20:41 <+bridge> [ddnet] just learned csgo has dxvk vulkan backend on linux :poggers: with tearing protocol merged it is time to install it on linux back 20:45 <+bridge> [ddnet] nice 😄 20:46 <+bridge> [ddnet] they were using abstraction layer for opnegl too right? smth like togl 20:48 <+bridge> [ddnet] yes, but with dxvk not anymore 20:48 <+bridge> [ddnet] they use dxvk-native 20:48 <+bridge> [ddnet] u can compile dx on linux now 😄 20:53 <+bridge> [ddnet] well looks like it's on upstream now https://github.com/Joshua-Ashton/dxvk-native 20:53 <+bridge> [ddnet] with dxvk 2 20:55 <+bridge> [ddnet] yep 20:56 <+bridge> [ddnet] so i added a new mod file koth.mod in the teeworlds 0.6 source for a gamemode 20:56 <+bridge> [ddnet] do i have to edit the cmake files somehow/ 20:56 <+bridge> [ddnet] it's returning a lot of errors 21:15 <+bridge> [ddnet] csgo was always native what u on about 21:15 <+bridge> [ddnet] dota 2 and csgo are native 21:16 <+bridge> [ddnet] @Not Keks im back 21:16 <+bridge> [ddnet] idk if i should put lot of load on the pc right now or let the thermal paste settle 21:18 <+bridge> [ddnet] before they use togl 21:18 <+bridge> [ddnet] now they use dxvk-native 21:18 <+bridge> [ddnet] wat 21:18 <+bridge> [ddnet] it runs better now 21:18 <+bridge> [ddnet] since they use vulkan 21:18 <+bridge> [ddnet] but why dxvk 21:18 <+bridge> [ddnet] on dota they have opengl and vulkan backend 21:19 <+bridge> [ddnet] bcs they dont want to port to source engine 2 21:19 <+bridge> [ddnet] thats fake 21:19 <+bridge> [ddnet] source 2 is in vulkan already 21:19 <+bridge> [ddnet] dota 2 uses source 2 21:19 <+bridge> [ddnet] yes 21:19 <+bridge> [ddnet] but csgo not 21:19 <+bridge> [ddnet] he talked about csgo xD 21:19 <+bridge> [ddnet] u came up with dota 21:19 <+bridge> [ddnet] but they use the same engine 21:19 <+bridge> [ddnet] well csgo is in source 1 21:19 <+bridge> [ddnet] yes 21:19 <+bridge> [ddnet] and its valve 21:19 <+bridge> [ddnet] source1 has no vk 21:19 <+bridge> [ddnet] but why call it dxvk 21:19 <+bridge> [ddnet] and not vulkan 21:20 <+bridge> [ddnet] stupid directx 21:20 <+bridge> [ddnet] make it go away 21:20 <+bridge> [ddnet] bcs its literaly dx9 compiled on linux 21:20 <+bridge> [ddnet] they use dx9 header files 21:20 <+bridge> [ddnet] blegh 21:20 <+bridge> [ddnet] and then dxvk as library 21:27 <+bridge> [ddnet] yeah it has dxvk with -vulkan now 21:27 <+bridge> [ddnet] and it is source 1 so 21:27 <+bridge> [ddnet] only problem is 21:27 <+bridge> [ddnet] can't change the resolution sadge 21:28 <+bridge> [ddnet] https://github.com/ValveSoftware/csgo-osx-linux/issues/2889 21:32 <+bridge> [ddnet] r u one of those pros that plays 4:3 xd 21:35 <+bridge> [ddnet] i'm one of those nobos that plays on 4:3 xd 21:37 <+bridge> [ddnet] stutters a lot, i hope it will stop after shader caching stuff is done xd 21:39 <+bridge> [ddnet] but fps is improved like +30% 21:39 <+bridge> [ddnet] maybe more 21:41 <+bridge> [ddnet] yeah it does 21:41 <+bridge> [ddnet] for me it fixed the bug of slow opening 21:41 <+bridge> [ddnet] with togl it always took like a minute to start 21:56 <+bridge> [ddnet] @Not Keks https://github.com/ValveSoftware/csgo-osx-linux/issues/2889#issuecomment-997804245 do u have any idea how can i do some workaround like this on wayland? :d 21:56 <+bridge> [ddnet] maybe with xwayland dunno 21:58 <+bridge> [ddnet] ohm can u set ddnet to such a resolution? xd 21:58 <+bridge> [ddnet] gotta try 22:00 <+bridge> [ddnet] https://twitter.com/OnDeck/status/1595160031036846080 22:00 <+bridge> [ddnet] gaben the lord and saviour 22:06 <+bridge> [ddnet] yep 22:08 <+bridge> [ddnet] well then there must be a command to set your whole compositor to that resolution i guess 😄 22:08 <+bridge> [ddnet] i never used wayland 22:08 <+bridge> [ddnet] never really 22:09 <+bridge> [ddnet] else compile own SDL2 for csgo that forces the resolution xd 22:09 <+bridge> [ddnet] 22:09 <+bridge> [ddnet] except they are static linking it 22:45 <+bridge> [ddnet] Server up there? 22:45 <+bridge> [ddnet] https://youtu.be/0O_VAEgJEcA 22:45 <+bridge> [ddnet] :justatest: 22:47 <+bridge> [ddnet] :monkalaugh: 22:47 <+bridge> [ddnet] i dont watch programming videos 22:47 <+bridge> [ddnet] microkernel 22:47 <+bridge> [ddnet] Its not programming video 22:49 <+bridge> [ddnet] i only optimize when some page gets too slow though, disk space is expensive so don‘t want indexes for everything 22:49 <+bridge> [ddnet] ddnet sql is probs not fast 22:49 <+bridge> [ddnet] since they rely on caching to a file 22:49 <+bridge> [ddnet] i mean the website pre calcs anyway doesnt it 22:49 <+bridge> [ddnet] but iirc the website doesnt do the rank calculation in the query 22:49 <+bridge> [ddnet] but disk space expensive is a word xd 22:49 <+bridge> [ddnet] it does it in python 22:50 <+bridge> [ddnet] only the parts which were too slow 22:50 <+bridge> [ddnet] does it not pre genearade a player's rank page? 22:51 <+bridge> [ddnet] yes, most of that page is precalculated 22:51 <+bridge> [ddnet] ok 22:51 <+bridge> [ddnet] @Not Keks i think he means adding a index to sql adds disk space 22:51 <+bridge> [ddnet] yes but the db is rather small 22:51 <+bridge> [ddnet] I doubt I can do the players page in 100ms with sql 22:51 <+bridge> [ddnet] i think its inefficient to pre render, you rly only need to cache the sql results 22:51 <+bridge> [ddnet] not the page itself 22:51 <+bridge> [ddnet] or just some parts 22:51 <+bridge> [ddnet] 1. its way smaller 22:52 <+bridge> [ddnet] 2. 22:52 <+bridge> [ddnet] async fetching 22:52 <+bridge> [ddnet] can be stored in memory 22:52 <+bridge> [ddnet] i simply store all the ranks in memory 22:52 <+bridge> [ddnet] but anyway the website is like it is 22:52 <+bridge> [ddnet] it‘s not the page, it‘s some results which i store in a msgpack file 22:52 <+bridge> [ddnet] i guess msgpack is less space efficient than just memory 22:52 <+bridge> [ddnet] so it‘s also in memory 22:52 <+bridge> [ddnet] msgpack is just the ondisk format to get it from one python process to the other 22:53 <+bridge> [ddnet] so it has to go on disk? 22:53 <+bridge> [ddnet] yes, some download it for other projects too 22:53 <+bridge> [ddnet] i think discord bot uses it 22:54 <+bridge> [ddnet] oh well 22:54 <+bridge> [ddnet] how often does it recalculate btw? 22:54 <+bridge> [ddnet] if i do the page and its accepted ill just remake the bot in rust too 22:54 <+bridge> [ddnet] and use bincode or smth idk 22:54 <+bridge> [ddnet] as often as it can run, it basically runs in a loop, around once per hour 22:54 <+bridge> [ddnet] damn once per hour 22:54 <+bridge> [ddnet] uff 22:54 <+bridge> [ddnet] python for ya 22:55 <+bridge> [ddnet] on my sv fetching and indexing the ranks takes 130s, then thats it 22:55 <+bridge> [ddnet] https://ddstats.org/players/Neben 22:55 <+bridge> [ddnet] player pages load instant 22:56 <+bridge> [ddnet] but with a precalculated/cached SQL? 22:56 <+bridge> [ddnet] yeah 22:56 <+bridge> [ddnet] ok 22:56 <+bridge> [ddnet] the script also generates the /ranks/ pages for all countries and global, the msgpack is just a sideeffect of that 22:56 <+bridge> [ddnet] i basically load all player ranks 22:56 <+bridge> [ddnet] i think making this party dynamic allows for even more combinations 22:56 <+bridge> [ddnet] cuz this can grow exponentially 22:57 <+bridge> [ddnet] part* 22:57 <+bridge> [ddnet] e.g comparing between regions 22:57 <+bridge> [ddnet] i like to write small fast sqls per need 22:57 <+bridge> [ddnet] then everything is always up to date 😄 22:57 <+bridge> [ddnet] yeah 22:58 <+bridge> [ddnet] but i think some caching is needed for player ranks, there is just too many 22:58 <+bridge> [ddnet] unless ur sql is magic 22:58 <+bridge> [ddnet] does it rly work 22:58 <+bridge> [ddnet] well i would never load all at once 22:58 <+bridge> [ddnet] i do that cuz otherwise i would hit a cache miss on every player page 22:58 <+bridge> [ddnet] see e.g. my sql for ranks in sqlite, 48ms sounds good enough 22:58 <+bridge> [ddnet] so i just do it all once 22:58 <+bridge> [ddnet] which is as fast as 1 player kinda 22:59 <+bridge> [ddnet] can u show it 22:59 <+bridge> [ddnet] i also once wrote an insanly optimized name search in sqlite, that can fetch maps, names etc in 3ms 22:59 <+bridge> [ddnet] 22:59 <+bridge> [ddnet] but it used 6gb disk space for the sqlite db from ddnet xD 23:00 <+bridge> [ddnet] xd 23:01 <+bridge> [ddnet] oh 23:01 <+bridge> [ddnet] servers might be updated now 23:01 <+bridge> [ddnet] so in theory skins are reported 23:01 <+bridge> [ddnet] i know what i will add to the player page 23:02 <+bridge> [ddnet] ok i guess servers dont run on master 23:03 <+bridge> [ddnet] f 23:07 <+bridge> [ddnet] ah btw with sqlite fts5 the query is also faster 23:07 <+bridge> [ddnet] completly forgot it 23:07 <+bridge> [ddnet] finding "Ryozuki" was still too slow 23:08 <+bridge> [ddnet] skins are coming to the player page? 23:10 <+bridge> [ddnet] whats this 23:10 <+bridge> [ddnet] it will be possible 23:10 <+bridge> [ddnet] cuz i added so the ddnet servers report things such as each player skin and color, and if they are afk or not 23:10 <+bridge> [ddnet] i think i know how to render them :troll: 23:10 <+bridge> [ddnet] and the team they are in 23:12 <+bridge> [ddnet] Full text search 23:13 <+bridge> [ddnet] Do if u type in the full string at once it can basically create a hash and find that 23:13 <+bridge> [ddnet] For example. Dunno how it is implemented 23:15 <+bridge> [ddnet] I also abused it for the insanely optimized search. Even with a wildcard search it could find all ranks of "Ryo" in 3ms. But as said it wasted quite a bit of disk space 23:16 <+bridge> [ddnet] Likely tw names are pretty short 23:16 <+bridge> [ddnet] Also it requires a higher level script to generate the input. So it's not pure SQL 23:16 <+bridge> [ddnet] Lukely tw names are pretty short 23:22 <+bridge> [ddnet] not really, no 23:32 <+bridge> [ddnet] Nop, buildings, my university has around 220 buildings and we manage the network part 23:33 <+bridge> [ddnet] It was a rly cool place 23:33 <+bridge> [ddnet] Nop, buildings, my university owns around 220 buildings and we manage the network part 23:36 <+bridge> [ddnet] Nop, just buildings, my university owns around 220 buildings