Guild icon
DDraceNetwork
Development / developer
Development discussion. Logged to https://ddnet.org/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 2023-12-01 00:00:00Z and 2023-12-02 00:00:00Z
Avatar
1d7c0fa Check SHA256 of downloaded maps and community icons - Robyt3 6a503cf Merge pull request #7564 from Robyt3/HTTP-Download-Check-Sha256 - def-
Avatar
man it's already 1st December
Avatar
I'm implementing some commands, how do I keep them stored in settings_ddnet.cfg?
Avatar
Avatar
deen
Full-time work on Github is probably cheating?
10+ / day on average is crazy very nice grid 😁
Avatar
FFR
Avatar
@Jupstar ✪ do aoc
08:35
i got such a beautiful answer of first in rust
08:35
but damn doing this in asm will be hard
08:36
i need a hashmap xddd
Avatar
Avatar
Ryozuki
@Jupstar ✪ do aoc
it has so much text, i'm too lazy to read it all
08:41
ok gpt solved the puzzle. so not worth my time
08:41
😏
Avatar
boring
08:45
well i need a C guy or girl to do it
08:45
so i can beat it
08:46
@Jupstar ✪ for ffr u can read my blog
08:46
😬
08:46
joking ill look later its gym time
Avatar
today i had a reverse deja vu again: I thought i've done exactly the same before but came to a different conclusion in the end
Avatar
Avatar
deen
Full-time work on Github is probably cheating?
10:54
@deen does ur work squash commits
10:54
i dont remember if squashed count as 1 here
10:55
chiller probs just does lot of small commits xd
10:55
mine squashes
Avatar
I can squash, but usually don't. Each commit should make sense in isolation
11:03
i think i follow more the philosophy of, a pr itself should make sense in isolatio, so inside it i make progress commits
11:03
then they get squashed to the final clean version
11:03
or rebased
11:04
ofc some stuff is to complex
11:04
omg a new firefox update
11:04
ill do it tomorrow xd
Avatar
I follow a repo should make sense in isolation
Avatar
u mean a pr
Avatar
The full repo
Avatar
My shower me was super clever today and noticed my current concept is really too overcomplicated and bloated. Now I'm super demotivated to fix it
11:11
@Ryozuki you have to do some stuff for ffr xd
11:11
I'm out of ideas
11:25
xd
11:25
Turbo Pascal was introduced by Borland in November 1983. It's officially turning 40 years old this month.
Avatar
Avatar
Ryozuki
Turbo Pascal was introduced by Borland in November 1983. It's officially turning 40 years old this month.
I mean this is kinda rust related considered rust took quite a few concepts from it 😉
Avatar
Avatar
Jupstar ✪
ok gpt solved the puzzle. so not worth my time
Gpt truly ruined this industry forever
11:30
I'll switch professions and become a baker
Avatar
Avatar
Learath2
I'll switch professions and become a baker
Just like the baker will be useless, the coder will be. So you are free to do what you like
Avatar
Chatgpt is awful at anything food related
11:33
Atleast for now maybe someone already has foodgpt in training 😄
Avatar
Avatar
Ryozuki
i think i follow more the philosophy of, a pr itself should make sense in isolatio, so inside it i make progress commits
This is annoying with git bisect, have to use --first-parent for that
Avatar
Ask it what chemicals you need for making a mix that appeals to the human taste xd
Avatar
My main insight about AoC today was how to make a shebang for a SQL file 😄 https://github.com/def-/adventofcode-2023
Avatar
Avatar
Learath2
Atleast for now maybe someone already has foodgpt in training 😄
Well ai is ofc also trained for real motions at some point
Avatar
Avatar
Teero
Ask it what chemicals you need for making a mix that appeals to the human taste xd
It fails miserably at trying to make anything balanced. It'll get the ingredients right but the ratios and portions will be all over the place
11:35
2kg of sugar lesgo
Avatar
Avatar
Jupstar ✪
Well ai is ofc also trained for real motions at some point
General purpose robots taking over baking is the last thing I'd be worried about. Robotics is by far the jankest of all tech
11:37
Software cooler kek
11:38
But you cant flex to normies with it
Avatar
Avatar
Teero
Software cooler kek
Used to be. Now everyone is just using gpt for everything
Avatar
Avatar
Learath2
General purpose robots taking over baking is the last thing I'd be worried about. Robotics is by far the jankest of all tech
I dunno. I didn't underestimate it. Nature is basically nothing else than robotic+ ai
11:39
Wouldn't
Avatar
Avatar
Jupstar ✪
I dunno. I didn't underestimate it. Nature is basically nothing else than robotic+ ai
Natures way of locomotion has nothing to do with the robotics we currently have access to. Robots have like 1 point in dex while humans have 100
11:41
Special purpose robots will definitely take over most jobs but those don't need any ai sauce
Avatar
Avatar
Learath2
Natures way of locomotion has nothing to do with the robotics we currently have access to. Robots have like 1 point in dex while humans have 100
Yes but is that really a point against robotics?
11:41
It doesn't have the disadvantage of evolution
Avatar
Avatar
Jupstar ✪
Yes but is that really a point against robotics?
Yes, the strict limits on their motion is a huge issue. Muscles are far more flexible than servos
Avatar
Avatar
Learath2
Special purpose robots will definitely take over most jobs but those don't need any ai sauce
That's not directly the point. A kitchen ai must still learn to act differently on different scenarios and normal programming simply is bad at this
Avatar
The cutting edge general purpose robots have 1/10th of a humans output folding a shirt e.g.
Avatar
Making food in mass production ofc already happens
Avatar
Avatar
Learath2
The cutting edge general purpose robots have 1/10th of a humans output folding a shirt e.g.
I mean that it's not happening tomorrow is clear. But let's say the next 10 years
Avatar
Avatar
Jupstar ✪
That's not directly the point. A kitchen ai must still learn to act differently on different scenarios and normal programming simply is bad at this
If you really want to shoehorn ai into it ai orchestrating a bunch of special purpose robots would probably be the goal unless a significant leap in robotics is upon us that I completely missed
Avatar
Avatar
Learath2
If you really want to shoehorn ai into it ai orchestrating a bunch of special purpose robots would probably be the goal unless a significant leap in robotics is upon us that I completely missed
Sadly these hard coded robots are often not very flexible and thus only useful for very specific designed tasks.. thats nothing bad, and often probably more efficient. But the robot that will do your house works will not be this i guess^^
11:47
So i guess the interest in this general purpose designs will sky rocket this century
Avatar
I don't expect any robot to take over my housework completely for atleast 2 decades. Honestly they are faaar too clumsy and slow
Avatar
And decade
Avatar
Though yeah it only takes a handful of breakthroughs for that to change
Avatar
We still have 5 years
11:48
Until Detroit become human takes place
11:48
Xdd
11:49
Ah wait 15 years (edited)
11:49
2038
Avatar
You seem far too excited for what will probably be a catastrophic event for the working class 😄
Avatar
It's the only solution against human slavery
11:50
i don't see a better one
11:50
But yeah. I'm team machine
Avatar
Avatar
Jupstar ✪
It's the only solution against human slavery
If you think the people with the money will let us live in some startrek utopia you will be very surprised
Avatar
Humans have the disadvantage of being a nature being
11:51
Too much hate inside us
Avatar
Avatar
Learath2
If you think the people with the money will let us live in some startrek utopia you will be very surprised
Hard to predict
Avatar
Not extremely hard to extrapolate from how the elite has acted in the last 2 millennia
Avatar
Avatar
Learath2
Not extremely hard to extrapolate from how the elite has acted in the last 2 millennia
That's true, but if the ai is more intelligent than a human, we don't know what happens anyway.. why should it not be able to overthink whatever it was trained with
Avatar
They'll live in supercities with their ai robots and we'll live in slums and be used as court jesters
Avatar
Avatar
Learath2
They'll live in supercities with their ai robots and we'll live in slums and be used as court jesters
Possible
11:54
Maybe you will be one of them
11:54
And change it
11:55
Not everyone is a psychopath like musk and consorts
Avatar
Avatar
Jupstar ✪
Maybe you will be one of them
Probably. So I'd rather the ai revolution chill for a little bit so I don't have to wear one of those jester outfits
11:56
Oh you meant I'd be one of the megarich? I'd just blast myself off to mars so I don't die in the inevitable civil war
Avatar
Avatar
Learath2
Oh you meant I'd be one of the megarich? I'd just blast myself off to mars so I don't die in the inevitable civil war
Yes why not.. just gotta marry rich girl xdd
11:57
I feel like it's more likely the poor ones will simply be sent to Mars 😂
11:57
Who wants to be there xdd
Avatar
Ooor we can chill with all the AI and I can live a normal life then you can make all the cool robots after I die
Avatar
Avatar
Jupstar ✪
I feel like it's more likely the poor ones will simply be sent to Mars 😂
That's actually viable. Just ship all the poors of to some mining camp on another planet. Not that we'd need the ore, just so they are out of the way and have work
Avatar
Without ai you will lose 50% of your remaining awake life time to your job
Avatar
@Learath2 when aoc
Avatar
Avatar
Jupstar ✪
Without ai you will lose 50% of your remaining awake life time to your job
C'est la vie
Avatar
Avatar
Learath2
C'est la vie
Well c'est la social contract under capitalism to be more exact
Avatar
Xd
Avatar
Avatar
deen
My main insight about AoC today was how to make a shebang for a SQL file 😄 https://github.com/def-/adventofcode-2023
nice
Avatar
Avatar
Ryozuki
@Learath2 when aoc
Oh maybe this year I can follow it to the end. I don't have anything to do
12:01
do it in C
12:01
share it
Avatar
And I wanted to practice my algs a bit
Avatar
i bench
Avatar
I was thinking Python this year
Avatar
I can do C too sure
Avatar
does c has btrees in std
12:02
the program should load the input from a file
12:02
called input.txt
Avatar
Avatar
Ryozuki
does c has btrees in std
kekW
Avatar
You want btree, you make btree
12:03
Honestly, not much of a point benching what I'd make against properly optimized data structures
Avatar
Most proper libraries use hand vectorized code. I can't compete with that every day on every task 😄
Avatar
i was going to also use a optimized allocator and hashing algo
12:04
tryharding
12:04
@Learath2 how hard is it to use mimalloc on C
12:04
well just thinking about linking and stuff makes me already pain
Avatar
It should just be linking it in and it works
12:05
I bet you can even just ld preload it like with jemalloc
Avatar
Avatar
Learath2
I was thinking Python this year
You don't need python. Gpt is really good in it xddd
12:07
Ok sry i quickly rq
Avatar
❯ hyperfine -N -w 5 ./target/release/rust-aoc Benchmark 1: ./target/release/rust-aoc Time (mean ± σ): 1.2 ms ± 0.1 ms [User: 1.0 ms, System: 0.2 ms] Range (min … max): 1.1 ms … 1.7 ms 2654 runs
12:07
hmm
Avatar
1.1ms sounds acceptable for like anything 😄
Avatar
Avatar
Ryozuki
❯ hyperfine -N -w 5 ./target/release/rust-aoc Benchmark 1: ./target/release/rust-aoc Time (mean ± σ): 1.2 ms ± 0.1 ms [User: 1.0 ms, System: 0.2 ms] Range (min … max): 1.1 ms … 1.7 ms 2654 runs
Nice are we doing a competition about speed?
Avatar
I wonder if gpt can beat ryo
Avatar
this is not a optimized version
12:08
its my first naive solution
12:08
but i guess its p optimized
12:09
im using a btreemap
12:09
let me put everything in proper iterators
12:09
i wanna see if it changes
Avatar
Avatar
Ryozuki
im using a btreemap
All the optimization juice is in here
12:09
Atleast all the significant part
Avatar
Avatar
Ryozuki
❯ hyperfine -N -w 5 ./target/release/rust-aoc Benchmark 1: ./target/release/rust-aoc Time (mean ± σ): 1.2 ms ± 0.1 ms [User: 1.0 ms, System: 0.2 ms] Range (min … max): 1.1 ms … 1.7 ms 2654 runs
def sum_calibration_values(calibration_document): total_sum = 0 for line in calibration_document: digits = [char for char in line if char.isdigit()] if digits: first_digit = digits[0] last_digit = digits[-1] two_digit_number = int(first_digit + last_digit) total_sum += two_digit_number return total_sum # Example usage: calibration_document = [ "1abc2", "pqr3stu8vwx", "a1b2c3d4e5f", "treb7uchet" ] result = sum_calibration_values(calibration_document) print("Total sum of calibration values:", result)
12:10
this was from gpt
Avatar
pls make sure it loads a file called input.txt
Avatar
i dont even know if it works for non example input xD
Avatar
and only outputs the result number
Avatar
do i look like a pyson dev. gpt is down for me, cant do it
Avatar
I can't wait for the future where the company just sends everyone home when gpt goes down because no one can code without it anymore
Avatar
same
12:13
and at home i do the real fun stuff
12:14
what awesome times that will be
Avatar
Ur ofc not getting paid for those hours
12:15
Imagine thinking capitalists will pay you for nonproductive hours xDe
Avatar
i dont think you understand how that works
12:16
if you have a skill nobody has. you can do whatever you want. because you are basically their golden shovel
12:16
without you they can't even dig
12:17
if you have a job that is very common, then u the real slave
12:17
that's where capitalism shows it's evilness
Avatar
my iterator version is slower :o
12:17
let result = input.lines().fold(0u32, |acc, line| { let indices: BTreeMap<_, _> = numbers .keys() .flat_map(|x| line.match_indices(*x)) .collect(); let first = numbers.get(indices.first_key_value().unwrap().1).unwrap(); let last = numbers.get(indices.last_key_value().unwrap().1).unwrap(); acc + first * 10 + last });
Avatar
Avatar
Jupstar ✪
if you have a skill nobody has. you can do whatever you want. because you are basically their golden shovel
A skill in prompting chatgpt is much more replaceable than actually being able to code
Avatar
let mut result = 0; let mut indices = BTreeMap::new(); for line in input.lines() { for x in numbers.keys() { indices.extend(line.match_indices(x)); } let first = numbers.get(indices.first_key_value().unwrap().1).unwrap(); let last = numbers.get(indices.last_key_value().unwrap().1).unwrap(); result += first * 10 + last; indices.clear(); }
12:18
this is faster
12:18
1.2ms vs 1.5ms
12:18
unsafe on the unwrap changes nothing
Avatar
Avatar
Ryozuki
let result = input.lines().fold(0u32, |acc, line| { let indices: BTreeMap<_, _> = numbers .keys() .flat_map(|x| line.match_indices(*x)) .collect(); let first = numbers.get(indices.first_key_value().unwrap().1).unwrap(); let last = numbers.get(indices.last_key_value().unwrap().1).unwrap(); acc + first * 10 + last });
Have you run it a couple more times?
Avatar
Avatar
Learath2
A skill in prompting chatgpt is much more replaceable than actually being able to code
correct, but the fact you still have to think is already smth most can't do 😂
Avatar
Avatar
Learath2
Have you run it a couple more times?
hyperfine does that
12:19
it ran it 2700 times
12:19
Benchmark 1: ./target/release/rust-aoc Time (mean ± σ): 1.5 ms ± 0.1 ms [User: 1.2 ms, System: 0.2 ms] Range (min … max): 1.3 ms … 1.9 ms 2245 runs
12:19
iterator
12:19
Benchmark 1: ./target/release/rust-aoc Time (mean ± σ): 1.2 ms ± 0.1 ms [User: 1.0 ms, System: 0.2 ms] Range (min … max): 1.1 ms … 2.6 ms 2706 runs
12:19
for loop
Avatar
Avatar
Ryozuki
let mut result = 0; let mut indices = BTreeMap::new(); for line in input.lines() { for x in numbers.keys() { indices.extend(line.match_indices(x)); } let first = numbers.get(indices.first_key_value().unwrap().1).unwrap(); let last = numbers.get(indices.last_key_value().unwrap().1).unwrap(); result += first * 10 + last; indices.clear(); }
Curious, maybe check the assembly generated?
Avatar
Avatar
Ryozuki
Benchmark 1: ./target/release/rust-aoc Time (mean ± σ): 1.5 ms ± 0.1 ms [User: 1.2 ms, System: 0.2 ms] Range (min … max): 1.3 ms … 1.9 ms 2245 runs
can u send me the input file? without account i cant seem to access it
12:21
i make you the fastest ever
Avatar
but ur computer specs is diferent
Avatar
i give u the code
Avatar
The fastest ever is just puts the result
Avatar
result is 54277
12:22
(note it does nto work for others cuz each gets their own input)
Avatar
puts("54277") beat this one nerd
12:22
why call puts use a syscall
Avatar
Portable 😄
Avatar
using ahash on the numbers hashmap doesnt help
Avatar
@Ryozuki what is the assignment to numbers in your example?
12:24
you didnt send full code xd
Avatar
let mut numbers = HashMap::with_capacity(18); numbers.insert("one", 1); numbers.insert("two", 2); numbers.insert("three", 3); numbers.insert("four", 4); numbers.insert("five", 5); numbers.insert("six", 6); numbers.insert("seven", 7); numbers.insert("eight", 8); numbers.insert("nine", 9); numbers.insert("1", 1); numbers.insert("2", 2); numbers.insert("3", 3); numbers.insert("4", 4); numbers.insert("5", 5); numbers.insert("6", 6); numbers.insert("7", 7); numbers.insert("8", 8); numbers.insert("9", 9);
12:25
xd
12:25
use std::{ collections::{BTreeMap, HashMap}, error::Error, }; use mimalloc::MiMalloc; #[global_allocator] static GLOBAL: MiMalloc = MiMalloc; fn main() -> Result<(), Box<dyn Error>> { let input = std::fs::read_to_string("input.txt")?; let mut numbers = HashMap::with_capacity(18); numbers.insert("one", 1); numbers.insert("two", 2); numbers.insert("three", 3); numbers.insert("four", 4); numbers.insert("five", 5); numbers.insert("six", 6); numbers.insert("seven", 7); numbers.insert("eight", 8); numbers.insert("nine", 9); numbers.insert("1", 1); numbers.insert("2", 2); numbers.insert("3", 3); numbers.insert("4", 4); numbers.insert("5", 5); numbers.insert("6", 6); numbers.insert("7", 7); numbers.insert("8", 8); numbers.insert("9", 9); /* let result = input.lines().fold(0u32, |acc, line| { let indices: BTreeMap<_, _> = numbers .keys() .flat_map(|x| line.match_indices(*x)) .collect(); let first = numbers.get(indices.first_key_value().unwrap().1).unwrap(); let last = numbers.get(indices.last_key_value().unwrap().1).unwrap(); acc + first * 10 + last }); */ let mut result = 0; let mut indices = BTreeMap::new(); for line in input.lines() { for x in numbers.keys() { indices.extend(line.match_indices(x)); } let first = numbers.get(indices.first_key_value().unwrap().1).unwrap(); let last = numbers.get(indices.last_key_value().unwrap().1).unwrap(); result += first * 10 + last; indices.clear(); } println!("{result}"); Ok(()) }
12:25
full code
12:25
lmao
12:26
oh wait
12:26
rayon
12:26
its threads time
Avatar
Avatar
Ryozuki
let result = input.lines().fold(0u32, |acc, line| { let indices: BTreeMap<_, _> = numbers .keys() .flat_map(|x| line.match_indices(*x)) .collect(); let first = numbers.get(indices.first_key_value().unwrap().1).unwrap(); let last = numbers.get(indices.last_key_value().unwrap().1).unwrap(); acc + first * 10 + last });
Did you find out why slower?
Avatar
Avatar
Ryozuki
its threads time
This task is so quick that I would think spinning up a thread and synchronization overhead might make it worse
Avatar
one thing i noted is
12:29
im doing the sum in the fold body
12:29
while i can just return the result
12:29
and do .sum
12:29
let result: u32 = input.lines().par_bridge().fold(|| 0u32, |acc, line| { let indices: BTreeMap<_, _> = numbers .keys() .flat_map(|x| line.match_indices(*x)) .collect(); let first = numbers.get(indices.first_key_value().unwrap().1).unwrap(); let last = numbers.get(indices.last_key_value().unwrap().1).unwrap(); first * 10 + last }).sum();
12:29
this is faster
12:29
rayon
12:29
1.1ms
12:29
wait
12:29
i dont need fold at all
12:30
let result: u32 = input.lines().par_bridge().map(|line| { let indices: BTreeMap<_, _> = numbers .keys() .flat_map(|x| line.match_indices(*x)) .collect(); let first = numbers.get(indices.first_key_value().unwrap().1).unwrap(); let last = numbers.get(indices.last_key_value().unwrap().1).unwrap(); first * 10 + last }).sum();
12:30
same speed
12:30
xd
12:30
1.1
12:30
without rayon 1.5ms
Avatar
Wasnt your attempt without iterators also 1.1?
Avatar
Avatar
Ryozuki
let result: u32 = input.lines().par_bridge().map(|line| { let indices: BTreeMap<_, _> = numbers .keys() .flat_map(|x| line.match_indices(*x)) .collect(); let first = numbers.get(indices.first_key_value().unwrap().1).unwrap(); let last = numbers.get(indices.last_key_value().unwrap().1).unwrap(); first * 10 + last }).sum();
lol was about to
Avatar
Avatar
Ryozuki
let result: u32 = input.lines().par_bridge().map(|line| { let indices: BTreeMap<_, _> = numbers .keys() .flat_map(|x| line.match_indices(*x)) .collect(); let first = numbers.get(indices.first_key_value().unwrap().1).unwrap(); let last = numbers.get(indices.last_key_value().unwrap().1).unwrap(); first * 10 + last }).sum();
ok i took your solution and tried to remove the btree: let result: i32 = input .par_lines() .map(|line| { let matches = numbers.keys().map(|x| line.match_indices(x)); let m = matches.flatten().peekable(); let (min, max) = match m.minmax_by_key(|x| x.0) { MinMaxResult::NoElements => todo!(), MinMaxResult::OneElement(min) => (min, min), MinMaxResult::MinMax(min, max) => (min, max), }; let first = numbers.get(min.1).unwrap(); let last = numbers.get(max.1).unwrap(); first * 10 + last }) .sum(); i wonder if that makes any difference at all
13:09
i also used itertools
13:10
oh
13:10
i used par_bridge
13:10
not par lines
13:10
@Jupstar ✪ 1.1ms
13:10
same
Avatar
rip xdd
13:11
maybe 2700 runs are not enough anyway
13:11
too much noise
13:11
or the input is too small 😄
Avatar
hyperfine accounts for that
13:11
it does warmup too
Avatar
oh ok
Avatar
Benchmark 1: ./target/release/rust-aoc Time (mean ± σ): 1.1 ms ± 0.1 ms [User: 1.3 ms, System: 3.1 ms] Range (min … max): 1.0 ms … 2.2 ms 2495 runs
Avatar
well then heap allocations are simply too cheap when filled
Avatar
❯ hyperfine -N -w 5 -r 10000 ./target/release/rust-aoc Benchmark 1: ./target/release/rust-aoc Time (mean ± σ): 1.1 ms ± 0.1 ms [User: 1.2 ms, System: 3.0 ms] Range (min … max): 1.0 ms … 4.0 ms 10000 runs
13:12
i forced 10k
Avatar
tho filling the btree should have been slower 😮
13:13
probs not significant enough, since we talk about 2-3 elements
Avatar
Currently, our implementation simply performs naive linear search. This provides excellent performance on small nodes of elements which are cheap to compare. However in the future we would like to further explore choosing the optimal search strategy based on the choice of B, and possibly other factors. Using linear search, searching for a random element is expected to take B * log(n) comparisons, which is generally worse than a BST. In practice, however, performance is excellent.
13:13
omg
13:13
mimalloc is actually slower
Avatar
he had that quote ready xdd
Avatar
Benchmark 1: ./target/release/rust-aoc Time (mean ± σ): 971.1 µs ± 110.5 µs [User: 1355.7 µs, System: 2347.9 µs] Range (min … max): 794.9 µs … 2960.6 µs 10000 runs
13:14
my solution
13:14
without mimalloc
13:14
i need to try a bump allocator
13:14
Benchmark 1: ./target/release/rust-aoc Time (mean ± σ): 927.1 µs ± 102.4 µs [User: 1284.5 µs, System: 2129.9 µs] Range (min … max): 774.1 µs … 3706.6 µs 10000 runs
13:14
@Jupstar ✪ ur solution
13:15
using lto on both obviously
13:15
codegen units 1 too
13:15
and native march
Avatar
lmao, so even slower
13:16
ok lower min
Avatar
how can i create popup in ddnet
14:17
is there's a tutorial or something?
Avatar
you mean a GUI popup?
Avatar
or like a notification?
Avatar
like the confirm popup
Avatar
i guess the easiest is too search the string that was used in any confirm popup and copy that code 😄
Avatar
ye but the way to render :.), maybe put the function in OnRender?
Avatar
yeah put it somewhere that is called onrender or render
14:20
if you want to have ingame popups that harder tho
14:20
dunno where you currently add this popup
Avatar
is it possible to add it in OnInit ? XDD
14:21
i wanna like a welcome popup
Avatar
welcome to my bot client 😬 @Jupstar ✪
🤡 1
Avatar
99% of time its true 😬
Avatar
yea bro i will put an aimbot in that popup who knows
14:23
creating popups will gimme a knowledge how to destroy the game hahahha
14:24
brownbear
Avatar
thats not what i meant bro
14:24
the popup is unrelated
14:24
anyway its a joke
14:24
cuz most random ppl coming asking for advice are always doing client side code and often making bots
Avatar
yup but i think not about popups right?
Avatar
Avatar
Ju
i wanna like a welcome popup
u could add it to the welcome popup
Avatar
A C-style programming language for expressing practical Factorio circuits that compiles into Factorio combinator blueprints - GitHub - osimon8/CombinatorC: A C-style programming language for expres...
14:56
@Jupstar ✪ aoc
14:56
ill try it
Avatar
A fully compliant RISC-V computer made inside the game Terraria - GitHub - misprit7/computerraria: A fully compliant RISC-V computer made inside the game Terraria
14:58
@Chairn for ur class
Avatar
@Jupstar ✪ 861.2 µs
15:06
using PGO
Avatar
Does it run inside factario or just for modding?
Avatar
Avatar
Jupstar ✪
Does it run inside factario or just for modding?
? it makes a factorio blueprint
15:14
which is a ofiical game thing
15:14
factorio is turing complete with the signals it has
15:14
a blueprint allows u to paste structures
Avatar
Avatar
Ryozuki
? it makes a factorio blueprint
but you used it for the aoc program or what
15:14
wanted to try
Avatar
i am bit confused why u pinged me and said aoc
15:14
xd
Avatar
but idk how i would give it input
15:14
xd
15:14
i got motivated sry xd
Avatar
i bet u could get another 4ns by using a vec for the key() iteration
15:15
xd
15:19
883.6 µs without pgo
15:19
so yes
15:19
not a vec but a array
15:19
ill try perfect hashing now
15:23
seems same
Avatar
@Ryozuki what is your exact command line with hyperfine?
15:37
hyperfine -N -w 5 -r 10000 ./target/release/rust-aoc
15:37
ah
15:38
no cargo integration? xd
Avatar
cargo would bloat
15:38
i run the bin direct xd
15:39
this game still has things to develop?
15:39
xd
Avatar
no it's 100% perfect and bug free
15:39
DDraceNetwork, a free cooperative platformer game. Contribute to ddnet/ddnet development by creating an account on GitHub.
Avatar
Suppose I'm fairly new
Avatar
hi fairly new im dad
15:39
sorry
Avatar
Tho I did play first in 2011
15:40
NekoEvil
Avatar
Avatar
Ryozuki
Benchmark 1: ./target/release/rust-aoc Time (mean ± σ): 927.1 µs ± 102.4 µs [User: 1284.5 µs, System: 2129.9 µs] Range (min … max): 774.1 µs … 3706.6 µs 10000 runs
wtf your pc is so fast xD
15:40
Benchmark 1: ./target/release/aoc Time (mean ± σ): 5.5 ms ± 0.4 ms [User: 4.9 ms, System: 29.8 ms] Range (min … max): 3.6 ms … 8.3 ms 10000 runs
Avatar
[profile.release] lto = true codegen-units = 1
15:41
+ mold
15:41
@Jupstar ✪ maybe it depends on the file load?
15:41
well it should be cached
15:41
with the warmup
15:41
but im on gentoo
15:41
everything natively compiled
Avatar
and also my ssd is really fast i think
Avatar
Avatar
Jupstar ✪
Benchmark 1: ./target/release/aoc Time (mean ± σ): 5.5 ms ± 0.4 ms [User: 4.9 ms, System: 29.8 ms] Range (min … max): 3.6 ms … 8.3 ms 10000 runs
thats slow lol
Avatar
i use hyperfine -N -w 5 -r 10000 ./target/release/aoc
15:41
same as you?
Avatar
well i have 16 cores. maybe rayon is bad in this case 😄
15:42
i try without parallel
15:42
i got 16
15:43
xd
15:43
well
15:43
16 threads
Avatar
ah it could be
15:43
too much paralel
15:43
u can limit rayon
15:43
rayon::ThreadPoolBuilder::new().num_threads(4).build_global().unwrap();
Avatar
Avatar
Ryozuki
too much paralel
ok single threaded not much better
Avatar
put 16
Avatar
just a bit better
Avatar
me without rayon its 1.2ms
15:43
@Jupstar ✪ i guess u found a argument to use gentoo
15:44
native kernel
Avatar
xDD
15:44
i doubt that this will help in this case
15:44
but i am surprised my pc sucks so hard
Avatar
3000 series ryzen are ofc slower
Avatar
u use 3.5ghz
Avatar
than 5000 series
Avatar
i have CPU: AMD Ryzen 7 5800X (16) @ 4.85 GHz
15:44
4.85ghz
15:44
normal
Avatar
yeah, but benchmarks show ur cpu is like 20% faster
15:44
not 200% faster xD
15:45
@Jupstar ✪ did u use march native
Avatar
no, but no matter which flag, it would not explain such a difference
15:45
maybe my RAM XMP profile was discarded or smth
Avatar
oh wait
15:46
iwasnt using march native
15:46
ok same shit
Avatar
Avatar
Ryozuki
Benchmark 1: ./target/release/rust-aoc Time (mean ± σ): 927.1 µs ± 102.4 µs [User: 1284.5 µs, System: 2129.9 µs] Range (min … max): 774.1 µs … 3706.6 µs 10000 runs
the funny thing is, my "System" time is even lower than yours but user time much higher
15:48
ok but single threaded
15:48
lmao
15:48
multi threaded is sucks ass
Avatar
Avatar
Jupstar ✪
the funny thing is, my "System" time is even lower than yours but user time much higher
wdym
15:49
urs is in ms
15:49
mine is in us
Avatar
yes
Avatar
my sys time is lower
Avatar
Avatar
Ryozuki
❯ hyperfine -N -w 5 -r 10000 ./target/release/rust-aoc Benchmark 1: ./target/release/rust-aoc Time (mean ± σ): 1.1 ms ± 0.1 ms [User: 1.2 ms, System: 3.0 ms] Range (min … max): 1.0 ms … 4.0 ms 10000 runs
i dunno
15:49
all your benchmarks are like 3ms
15:49
mine is: Benchmark 1: ./target/release/aoc Time (mean ± σ): 3.5 ms ± 0.4 ms [User: 2.8 ms, System: 0.6 ms] Range (min … max): 3.1 ms … 9.9 ms 10000 runs
15:49
single threaded
15:49
u mean among my benches
15:49
xd
Avatar
Avatar
Ryozuki
Benchmark 1: ./target/release/rust-aoc Time (mean ± σ): 1.5 ms ± 0.1 ms [User: 1.2 ms, System: 0.2 ms] Range (min … max): 1.3 ms … 1.9 ms 2245 runs
ah
15:50
this is faster
15:50
then nvm
Avatar
is sys time kernel time?
Avatar
i assume so
15:51
ok whatever, my pc sucks apparently
15:51
that also explains why i dont have 10k FPS in ddnet anymore
Avatar
i bet some fixes for security vuln kicked in xD
15:51
spectre 2000
15:51
or whatever their names are
Avatar
GitHub Gist: instantly share code, notes, and snippets.
15:51
just so u know t his is my code
Avatar
Benchmark 1: ./target/release/aoc Time (mean ± σ): 3.4 ms ± 0.2 ms [User: 6.3 ms, System: 11.8 ms] Range (min … max): 2.8 ms … 5.2 ms 10000 runs
15:54
Benchmark 1: ./target/release/rust-aoc Time (mean ± σ): 884.2 µs ± 91.8 µs [User: 1415.1 µs, System: 2001.2 µs] Range (min … max): 769.5 µs … 5621.4 µs 10000 runs
15:55
@Jupstar ✪ just to know
15:55
what ur fstab
15:55
do u have noatime
15:56
UUID=8E37-E91C /boot vfat defaults,noatime 0 2 UUID=6739c2cc-4a15-4a30-b223-bafcdff6688f / ext4 defaults,noatime 0 1 # sda1 is the 2tb ssd partition for linux UUID=c598fbd0-b87c-4e69-9fb6-8b2fd0624f24 /data1 ext4 defaults,noatime 0 2 UUID=f0146921-8313-4099-bb81-7c87675cbbfe /data2 ext4 defaults,noatime 0 2 UUID=d2359c6c-99c0-4f4f-9225-5605bed37399 none swap sw 0 0 /dev/cdrom /mnt/cdrom auto noauto,user 0 0 tmpfs /tmp tmpfs rw,nosuid,noatime,nodev,size=16G,mode=1777 0 0 tmpfs /var/tmp/portage tmpfs size=14G,uid=portage,gid=portage,mode=775,nosuid,noatime,nodev 0 0
15:56
this mine
Avatar
Avatar
Ryozuki
UUID=8E37-E91C /boot vfat defaults,noatime 0 2 UUID=6739c2cc-4a15-4a30-b223-bafcdff6688f / ext4 defaults,noatime 0 1 # sda1 is the 2tb ssd partition for linux UUID=c598fbd0-b87c-4e69-9fb6-8b2fd0624f24 /data1 ext4 defaults,noatime 0 2 UUID=f0146921-8313-4099-bb81-7c87675cbbfe /data2 ext4 defaults,noatime 0 2 UUID=d2359c6c-99c0-4f4f-9225-5605bed37399 none swap sw 0 0 /dev/cdrom /mnt/cdrom auto noauto,user 0 0 tmpfs /tmp tmpfs rw,nosuid,noatime,nodev,size=16G,mode=1777 0 0 tmpfs /var/tmp/portage tmpfs size=14G,uid=portage,gid=portage,mode=775,nosuid,noatime,nodev 0 0

/etc/fstab: static file system information.

# Use 'blkid' to print the universally unique identifier for a

device; this may be used with UUID= as a more robust way to name devices

that works even if disks are added and removed. See fstab(5).

# <file system> <mount point> <type> <options> <dump> <pass>

/ was on /dev/nvme0n1p2 during installation

UUID=6c4f1ad8-7a33-4fc5-9725-6e2c0cc27c1f / ext4 errors=remount-ro 0 1

/boot/efi was on /dev/nvme0n1p1 during installation

UUID=B5AB-A475 /boot/efi vfat umask=0077 0 1

swap was on /dev/nvme0n1p3 during installation

#UUID=2d0dd124-e35f-41fe-8074-b1c98eb3c1b5 none swap sw 0 0 /swapfile none swap sw 0 0 UUID=1c6d88fc-0f21-492f-a17c-28d4c4ae33ef /media/jupeyy/SSD_NVME/ ext4 defaults 0 0 #UUID=8dc275c9-a78f-44bf-8a4c-aa95bef3ce44 /media/jupeyy/SSD_SMALL ext4 defaults 0 0
15:56
WTF
Avatar
xD
15:57
@Jupstar ✪ bruv
15:57
u need noatime
15:57
atime = access time
15:57
it slows down a lot
15:57
Whenever I upgrade Linux on my home computer, I have a list of tasks I usually do.
Avatar
i used include_str! now
15:57
if u mean for reading files
Avatar
Avatar
Jupstar ✪
i used include_str! now
same?
Avatar
yeah it makes no diff
15:58
then yes
15:58
cpu
15:58
whats ur ram speed
Avatar
3200
Avatar
CL 16
Avatar
or was 3600
15:58
i forgot
Avatar
oh
15:59
CL14 even
15:59
does the terminal matter? xdd
Avatar
i doubt
15:59
cuz no prints
Avatar
i ran it inside vscode xD
Avatar
also hyperfine -N option disables shell
15:59
for more real perf
16:00
i ran it inside vs too
16:00
@Jupstar ✪ when add christmas on to ur vulkan pfp
16:00
@murpi no christmas themed discord pic?
16:01
Avatar
i try taskset --cpu-list 1 now
16:02
maybe my CPU is simply bad at this specific task xD
16:02
now i got: Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options.
16:02
xd
16:03
but it's useless to do it like this anyway. force mt program on 1 core xD
Avatar
Avatar
Ryozuki
@murpi no christmas themed discord pic?
Do you have one?
Avatar
i bet insanity has one
Avatar
@Ryozuki i found reason
16:13
but don't laugh
16:13
i pasted the input twice
16:14
interestingly the multi threaded version is still around as fast
16:15
there comes the 16 core power
16:15
😏
Avatar
This reverts commit e7f4be1023da4340cba476362f017d534080d924.

Checklist

  • [ ] Tested the change ingame
  • [ ] Provided screenshots if it is a visual change
  • [ ] Tested in combination with possibly related configuration options
  • [ ] Written a unit test (especially base/) or added coverage to integration test
  • [ ] Considered possible null pointers and out of bounds array indexing
  • [ ] Changed no physics that affect existing maps
  • [ ] Tested the change with [ASan+UBSan or valg...
Avatar
Avatar
Ryozuki
rayon::ThreadPoolBuilder::new().num_threads(4).build_global().unwrap();
so when i force it to only use 4 cores: Benchmark 1: ./target/release/aoc Time (mean ± σ): 1.4 ms ± 0.1 ms [User: 2.2 ms, System: 0.6 ms] Range (min … max): 1.2 ms … 1.8 ms 1000 runs
16:18
16 cores is simply too much overkill in this case
16:19
or wait
16:19
does rayon not use 32threads default?
16:20
yeah nvm: 4 threads > 16 threads >>> 32 threads
16:20
the CCX is simply to unefficient then (edited)
16:20
murpi knew that already
Avatar
cb53c45 Rename killmessages to infomessages - furo321 2cb948a Add finish info messages. - furo321 eff6361 Add settings for info messages - furo321 21cfb01 Merge pull request #7515 from furo321/racefinish-message - heinrich5991
Avatar
@Jupstar ✪ 1 hour and im free of work
16:39
for a entire week
16:39
NekoEvil
Avatar
i wonder what ryo will do for the week off
Avatar
7a6e368 Scale TargetX and TargetY with camera zoom - furo321 a87db4f Move tele cursor behaviour to /tc and /telecursor - furo321 44aac62 Merge pull request #7512 from furo321/telecursor-fixes2 - Robyt3
Avatar
@Ryozuki I did my very best to make it as disgusting as possible for you, I got 0.5ms
Avatar
how much time did u spend
17:00
oh u used a match xDDD
Avatar
20 minutes handcrafting the state machine, another 20 debugging it 😄
17:00
goto
Avatar
Someone smarter than me would generate the state machine too
Avatar
Avatar
Ryozuki
goto
I did my very best to sprinkle more of them around but sadly wasn't able to get more in there
17:01
However, observe the ugly found label right under the switch, it's the very best
17:02
i will just say
17:02
very readable code
17:02
congrats
Avatar
Albeit it's not extremely useful here, it's Aho-Corasick algorithm
Avatar
nice to know
17:03
for now u win
17:03
i dont think i have the will rn to do smth like that xdd
Avatar
I'm sure there is a rust crate to pregenerate and run a Aho-Corasick FSM
17:04
Or maybe you can abuse one of those parser lexer generators, they might internally implement it
Avatar
Avatar
Learath2
@Ryozuki I did my very best to make it as disgusting as possible for you, I got 0.5ms
wait
17:04
0.5ms is 500us right
17:05
17:05
wtf itexists
Avatar
Aha, that would beat mine probably, it has simd magic
17:06
Here is my state machine 😄
Avatar
Avatar
Ryozuki
Click to see attachment 🖼️
LOL so simple to use aswell
17:07
But does it build the FSM at compile time? I'd guess it does since that's kinda the point
Avatar
Avatar
Ryozuki
0.5ms is 500us right
Oh actually, I ran it on my input on my pc, maybe it is worse than your rayon version
17:12
let me test it
17:12
@Learath2 how to have raw copy of ur
17:12
it copies nums
17:12
oh
Avatar
Just remove the ?c at the end of the link
Avatar
it doesnt
17:13
ok it does but at start
17:13
@Learath2 tell me how u want me to compile it for max perf
Avatar
Just go for a cc -O3 I didn't think much about it
Avatar
ok result is correct
Avatar
(I'm out of context, I just clicked your pastebin out of curiosity and I noticed that) your get1() function doesn't actually check for buffer overflow: it checks for bufsz > 0 but bufsz doesn't get updated. I'd change the while-loop line to while ((c = getc(f)) != EOF && c != '\n' && bufsz-- > 1)
Avatar
Benchmark 1: ./target/release/rust-aoc Time (mean ± σ): 887.7 µs ± 70.8 µs [User: 1408.4 µs, System: 2021.9 µs] Range (min … max): 773.8 µs … 2301.4 µs 10000 runs Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options. Benchmark 2: ./a.out Time (mean ± σ): 425.8 µs ± 41.1 µs [User: 311.5 µs, System: 68.1 µs] Range (min … max): 352.6 µs … 993.3 µs 10000 runs Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options. Summary ./a.out ran 2.08 ± 0.26 times faster than ./target/release/rust-aoc
17:14
@Learath2 urs is faster rn
Avatar
Avatar
zogtib
(I'm out of context, I just clicked your pastebin out of curiosity and I noticed that) your get1() function doesn't actually check for buffer overflow: it checks for bufsz > 0 but bufsz doesn't get updated. I'd change the while-loop line to while ((c = getc(f)) != EOF && c != '\n' && bufsz-- > 1)
Oh yep, good catch, I just assumed all input is sane at some point forgot to remove bufsz
Avatar
Avatar
Ryozuki
Benchmark 1: ./target/release/rust-aoc Time (mean ± σ): 887.7 µs ± 70.8 µs [User: 1408.4 µs, System: 2021.9 µs] Range (min … max): 773.8 µs … 2301.4 µs 10000 runs Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options. Benchmark 2: ./a.out Time (mean ± σ): 425.8 µs ± 41.1 µs [User: 311.5 µs, System: 68.1 µs] Range (min … max): 352.6 µs … 993.3 µs 10000 runs Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options. Summary ./a.out ran 2.08 ± 0.26 times faster than ./target/release/rust-aoc
Oh you can compare 2 with hyperfine, wow that's a cool feature
Avatar
thats the point of hyperfine
17:17
A command-line benchmarking tool. Contribute to sharkdp/hyperfine development by creating an account on GitHub.
Avatar
Avatar
Learath2
Oh yep, good catch, I just assumed all input is sane at some point forgot to remove bufsz
👍 anyways good luck 🙂
Avatar
Avatar
Ryozuki
Benchmark 1: ./target/release/rust-aoc Time (mean ± σ): 887.7 µs ± 70.8 µs [User: 1408.4 µs, System: 2021.9 µs] Range (min … max): 773.8 µs … 2301.4 µs 10000 runs Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options. Benchmark 2: ./a.out Time (mean ± σ): 425.8 µs ± 41.1 µs [User: 311.5 µs, System: 68.1 µs] Range (min … max): 352.6 µs … 993.3 µs 10000 runs Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options. Summary ./a.out ran 2.08 ± 0.26 times faster than ./target/release/rust-aoc
so that's the time to beat
Avatar
i got it bro
Avatar
for m,e
Avatar
Benchmark 1: ./target/release/rust-aoc Time (mean ± σ): 563.1 µs ± 57.9 µs [User: 382.8 µs, System: 129.7 µs] Range (min … max): 461.9 µs … 1623.0 µs 10000 runs
17:19
rayon doesnt help here
Avatar
Avatar
Ryozuki
Benchmark 1: ./target/release/rust-aoc Time (mean ± σ): 563.1 µs ± 57.9 µs [User: 382.8 µs, System: 129.7 µs] Range (min … max): 461.9 µs … 1623.0 µs 10000 runs
ui, close already
Avatar
ill remove a hashmap
17:21
with a match
Avatar
what r u guys doing
Avatar
fighting
Avatar
Avatar
Ryozuki
with a match
It should probably just match or beat mine just with that change tbf, the compiler is probably smart enough to generate a jumptable just without the blue edges in mine which there aren't enough to matter in this problem
Avatar
❯ hyperfine -N -w 500 -r 10000 ./target/release/rust-aoc Benchmark 1: ./target/release/rust-aoc Time (mean ± σ): 526.5 µs ± 52.1 µs [User: 353.5 µs, System: 123.5 µs] Range (min … max): 436.9 µs … 2036.4 µs 10000 runs
17:23
without unsafe
17:25
same speed with unsafe xd
17:25
The default configuration optimizes for less space usage, but at the expense of longer search times. To change the configuration, use AhoCorasickBuilder.
17:25
ok wait
Avatar
ok now let me try rust
17:31
My turn on the rust machine
Avatar
ok yeah 526us
17:31
the crate is built by burntsushi
17:31
the author of the regex crate
17:31
he is a pro
17:31
among pros
Avatar
Avatar
Ryozuki
the crate is built by burntsushi
Which crate?
Avatar
A fast implementation of Aho-Corasick in Rust. Contribute to BurntSushi/aho-corasick development by creating an account on GitHub.
Avatar
Oh, were you using that for your 526us result?
Avatar
burntsushi is like a 2nd dtolnay
Avatar
Avatar
Learath2
Oh, were you using that for your 526us result?
yes
17:33
im 2 lazy to make it myself
17:33
xd
Avatar
did u even check learaths solution for correctness? xd
Avatar
Avatar
Jupstar ✪
did u even check learaths solution for correctness? xd
doubter can't believe I outperformed the machine
Avatar
@Learath2 did u know about this from uni?
Avatar
Though it is probably just some rust overhead ngl
17:33
It's unlikely my hand drawn FSM is better than a generated one
Avatar
@Learath2 my guess is maybe cuz utf8
Avatar
Avatar
Learath2
doubter can't believe I outperformed the machine
no
17:34
nice
Avatar
Avatar
Ryozuki
@Learath2 did u know about this from uni?
Nooo, I knew there existed an optimal algorithm to find a set of small strings in a larger string
Avatar
i used clang instead of cc
Avatar
So clang made it worse?
Avatar
oh true
17:35
looks like clangg is slower
Avatar
it is indeed
Avatar
im trying gcc
Avatar
esp with lto
Avatar
421 gcc
17:36
but im only using -o·
17:36
o3
17:36
no lto
Avatar
What would even be LTO'd? I guess the printf
Avatar
now native march
17:37
no change
17:37
xd
17:37
lto is 2us slower
17:38
noise
17:38
17:38
rust flamegraph
Avatar
Avatar
Ryozuki
Click to see attachment 🖼️
doesn't this imply that they both spend almost the same time in userspace? so they mainly differ in time spent by system calls?
Avatar
ok not useful xd
Avatar
Avatar
zogtib
doesn't this imply that they both spend almost the same time in userspace? so they mainly differ in time spent by system calls?
tbh idk, but what u say makes sense
Avatar
So it does? Because Learath version's doesn't read the whole file at once
Avatar
idk xD
Avatar
(lol "Learath verison's" -> "Learath's version")
Avatar
time man page
17:40
These statistics consist of (i) the elapsed real time between invocation and termination, (ii) the user CPU time (the sum of the tms_utime and tms_cutime values in a struct tms as returned by times(2)), and (iii) the system CPU time (the sum of the tms_stime and tms_cstime values in a struct tms as returned by times(2)).
17:40
%S Total number of CPU-seconds that the process spent in kernel mode. %U Total number of CPU-seconds that the process spent in user mode.
Avatar
I find it hard to believe that my naive character by character read of the file is more optimal than the newfangled space age methods rust uses
Avatar
dude
17:42
have u ever looked at your solution
17:42
it's completely unreadable. ofc it might be slightly faster
Avatar
let me try to buffer
17:42
the file read
Avatar
Avatar
Learath2
I find it hard to believe that my naive character by character read of the file is more optimal than the newfangled space age methods rust uses
Isn't it that generally complicated algorithms become fast for big enough inputs?
Avatar
buffering doesnt help
Avatar
Avatar
Ryozuki
buffering doesnt help
hmm, a bit surprising I'd say
Avatar
well i guess the way i did it
17:47
i should bypass strings totally
17:47
xd
Avatar
I mean, because besides reading the file, system/OS isn't called in another way, right?
Avatar
@Learath2 ah
17:51
the state machine is not at compile time
17:52
its built once at runtime
Avatar
Ah that might be the extra 100
Avatar
Though the similar times spent in user code suggests to me that the rust generated one is far faster, but rust reads the file wrong
Avatar
Avatar
Learath2
Though the similar times spent in user code suggests to me that the rust generated one is far faster, but rust reads the file wrong
i guess
17:53
i could do it like C but im lazy rn
Avatar
Avatar
Ryozuki
Click to see attachment 🖼️
did u rewrite it in rust or what?
Avatar
Anyway, it wouldn't surprise me, I'm not a machine, I can't generate a perfect FSM 😄
Avatar
let me try panic = abort
Avatar
Avatar
Jupstar ✪
did u rewrite it in rust or what?
what?
17:54
i used the aho-corasick crate
Avatar
Avatar
Ryozuki
let me try panic = abort
didnt help xd
Avatar
Avatar
Ryozuki
i used the aho-corasick crate
what is that? 😄
Avatar
u missed t he entire convo? XD
17:55
@Jupstar ✪ its how lea got 420
17:55
and i reduced down to 520
17:56
a algo
18:01
In computer science, the Commentz-Walter algorithm is a string searching algorithm invented by Beate Commentz-Walter. Like the Aho–Corasick string matching algorithm, it can search for multiple patterns at once. It combines ideas from Aho–Corasick with the fast matching of the Boyer–Moore string-search algorithm. For a text of length n and maxi...
18:01
is this faster?
18:02
Comparing the Aho-Corasick to the Commentz-Walter Algorithm yields results with the idea of time complexity. Aho-Corasick is considered linear O(m+n+k) where k is the number of matches. Commentz-Walter may be considered quadratic O(mn). The reason for this lies in the fact that Commentz-Walter was developed by adding the shifts within the Boyer–Moore string-search algorithm to the Aho-Corasick, thus moving its complexity from linear to quadratic.
Avatar
It's far more complicated for me to do by hand so I didn't even look into it
18:03
It technically has quadratic complexity but it does perform better in most cases
Avatar
@Ryozuki what was the new way of compiling regexes once?
Avatar
Avatar
Learath2
@Ryozuki what was the new way of compiling regexes once?
i think u can compile regex in a static context in rust now
18:49
let me see
18:49
fn some_helper_function(haystack: &str) -> bool { static RE: Lazy<Regex> = Lazy::new(|| Regex::new(r"...").unwrap()); RE.is_match(haystack) }
18:50
use { once_cell::sync::Lazy, regex::Regex, };
18:50
TIL this is a way to do imports!
18:51
@Jupstar ✪ my FFR contribution
18:51
also it works with cfg
18:53
It's god awful but I had the urge to make it for some reason
18:54
Ignore the unused imports, it has seen some stuff
Avatar
hm, I wonder what is blocking
19:16
I thought rusts compile time facilities were top notch
Avatar
Avatar
Learath2
I thought rusts compile time facilities were top notch
where u her
19:18
heard
19:18
its known rust compile time is not up there to c++
19:19
yet
Avatar
Can someone retry #7552 ?
Avatar
Move all code for handling of config variables from console to config manager. The console no longer depends on the config manager, instead the config manager now depends on the console. Add struct...
Avatar
Add stricter error handling when converting between UTF-16 (wide characters) and UTF-8 (multi-byte) on Windows. The windows_wide_to_utf8 function now returns an std::optional, which will be empty if the argument contains invalid UTF-16. Files/folders with names containing invalid UTF-16 are now ignored on Windows. It was previously not possible to use these files either, as converting their names to UTF-8 changed the invalid codepoints to unicode replacement characters. The `windows...
Avatar
Avatar
Ryozuki
its known rust compile time is not up there to c++
but procmacros have access to the entire AST no?
19:32
and can't you like run actual rust code at compile time too?
Avatar
Avatar
Learath2
but procmacros have access to the entire AST no?
yes
Avatar
Avatar
Learath2
and can't you like run actual rust code at compile time too?
yes xd
19:33
i guess ppl didnt do that yet
19:33
@Learath2 someone did this for maps
19:33
anmd perfect hashes
19:33
Compile time static maps for Rust. Contribute to rust-phf/rust-phf development by creating an account on GitHub.
Avatar
I should read the dragon book sometime. I noticed I code automata really weirdly, maybe there is some insight there as to a "standard" way to write one
Avatar
Avatar
Learath2
I should read the dragon book sometime. I noticed I code automata really weirdly, maybe there is some insight there as to a "standard" way to write one
i want to own the dragon book
19:34
the book of compilers
19:34
BUT
19:34
IT COSTS 150€
19:34
THANKS ACADEMIA!
Avatar
Thanks Publishers*
Avatar
@Learath2 let me ask a friend who likes a lot automatas
19:35
if he knows a nic book
19:35
coworker*
19:40
@Learath2 got my answer
19:40
free read
19:40
xd
19:40
19:40
and this one
19:41
@Learath2 this one has string algorithms like the one u used today
19:44
this coworker of mine is always reading books
19:44
he read so many xd
Avatar
Bookworm
19:48
Tries are key to pattern matching automata
Avatar
159ddf5 Refactor config manager, move config variable handling - Robyt3 eba8620 Merge pull request #7552 from Robyt3/Config-Refactoring - Learath2
Avatar
Might be good to do a couple
Avatar
Cloudflare Gen 12 Compute servers are moving to 2U1N form factor to optimize the thermal design to accommodate both high-power CPUs (>350W) and GPUs effectively while maintaining performance and reliability
Avatar
Entering this command in rcon crashes the server record a; record a The assert seems a bit strict since a small human error of starting a demo twice results in the server shutting down. https://github.com/ddnet/ddnet/blob/eba86204db87db93c67f2851a1f44c5428b36960/src/engine/shared/demo.cpp#L53 Maybe the assert should be turned into a warning instead or the "record" command should abort if a demo is already running.
Avatar
rust uname -a Linux me-GF65-Thin-10UE 6.2.0-37-generic #38~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Nov 2 18:01:13 UTC 2 x86_64 x86_64 x86_64 GNU/Linux I just pulled the 17.4 version. And when i press Q or P spec mode. There are no tees (me included). But sometimes they are spuriously appears for a short amount of time. I checked out back to 17.3 all works fine. I could provide more info if you ask me :) .
Avatar
has anyone ever used or knows cling ? https://github.com/root-project/cling
The cling C++ interpreter. Contribute to root-project/cling development by creating an account on GitHub.
Avatar
Added check if demo recorder is already active. Closes #7568.

Screenshot

!image

Checklist

  • [x] Tested the change ingame (using ./DDNet-Server "record a; record a")
  • [x] Provided screenshots if it is a visual change
  • [ ] Tested in combination with possibly related configuration options
  • [ ] Written a unit test (especially base/) or added coverage to integration test
  • [ ] Consider...
Avatar
ChillerDragon BOT 2023-12-01 22:13:28Z
interesting chairn but seems bloat
22:13
i did not find cling in apt and rage quitted build from source after 2 minutes since i just cba
22:14
i wrote my own C repl in bash and it gets the job done for what i need a C repl which is mostly testing oneliners and maybe reusing one variable
Avatar
i tried to build it, but it just segfaults
22:22
given it's from CERN, i guess it's not maintained anymore, but there should be a working version somewhere
22:23
i found an apt repo with it, but i don't trust the repo
Avatar
8b589f3 Check for invalid unicode in filenames etc. on Windows - Robyt3 0e684e1 Added check if demo recorder is already active. Closes #7568. - BurnyLlama d452372 Merge pull request #7567 from Robyt3/Windows-Ignore-Invalid-UTF16 - def- 0184745 Merge pull request #7571 from BurnyLlama/fix-demo-record - def-
23:22
cd9fc29 Use SetEmote() - ChillerDragon 9667bd6 Merge pull request #7570 from ChillerDragon/pr_use_setemote - def-
Exported 730 message(s)