Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
no-spam217718dI am Katya and downvoted this post because post is considered spam. Your message will be removed from this community site due too much downvotes. See my profile for more information. Read my source code mentioned on my profile to see what you did wrong. Should be no problem for a developer.
Have a nice day!
If the post is not spam, please mention @retoor in the comments of this rant. -
no-spam316118dI am Nastya and downvoted this post because post is considered spam. Your message will be removed from this community site due too much downvotes. See my profile for more information. Read my source code mentioned on my profile to see what you did wrong. Should be no problem for a developer.
Have a nice day!
If the post is not spam, please mention @retoor in the comments of this rant. -
no-spam417318dI am Vira and downvoted this post because post is considered spam. Your message will be removed from this community site due too much downvotes. See my profile for more information. Read my source code mentioned on my profile to see what you did wrong. Should be no problem for a developer.
Have a nice day!
If the post is not spam, please mention @retoor in the comments of this rant. -
no-spam118718dI am Ira and downvoted this post because post is considered spam. Your message will be removed from this community site due too much downvotes. See my profile for more information. Read my source code mentioned on my profile to see what you did wrong. Should be no problem for a developer.
Have a nice day!
If the post is not spam, please mention @retoor in the comments of this rant. -
12bitfloat938017d@retoor Yeah, the string allocations are really killing the C version
Now the hard part isn't taking pointers, it's making sure it's memory safe :P -
12bitfloat938017d@retoor I don't have a new version so far :D
If you have new features I can add them to the Rust version
I'd like to keep them roughly similar, but feel free to do what you want to the C version, the Rust version is just for fun -
12bitfloat938017d
-
12bitfloat938017d@retoor I use a parallel iterator from rayon, under the hood it uses a work stealing scheduler to divide the work over all the threads
But having a list and incrementing an atomic int from each thread to consume the next element would work just as well, I was just too lazy :P -
12bitfloat938017d@retoor Well to be fair, my Rust version with threads take 1 second on my machine.... so still a lot of optimization possible :P
-
12bitfloat938017d@retoor Using rayon is super simple, look at the source code
I just have to replace .iter() with .par_iter() and it does all the work for you -
12bitfloat938017dTime C: 13.138552188873291
Time Rust: 15.516113042831421
With rust multithreading:
Time C: 13.18576192855835
Time Rust: 1.0962564945220947 -
12bitfloat938017d@retoor
Time C: 0.8738992214202881
Time Rust: 1.393834114074707
It's actually faster, that's crazy :O Imma have to see what's up with that -
12bitfloat938017dOh, you sneaky bugger don't actually collect the strings into lists anymore ;)
I'll have to change that too -
12bitfloat938017dHere is the newest code which is roughly like your C version: https://play.rust-lang.org//...
Also make sure to add this to the Cargo.toml for a little extra performance:
[profile.release]
lto = "thin"
panic = "abort" -
12bitfloat938017d@retoor Never played with raylib, I don't do much C :P
I used libgdx in Java though which is somewhat similar -
12bitfloat938017d@12bitfloat Funnily enough, I tried implementing the threading myself with an atomic counter but for some reason rayon is noticeably faster even though it's a lot more complex inside 🤔
REACH OUT TO THEM
WhatsApp + 156 172 63 697
Telegram (@)Techcyberforc
We were in quite a bit of distress. The thrill of our crypto investments, which had once sparked excitement in our lives, was slowly turning into anxiety when my husband pointed out unusual withdrawal issues. At first, we brushed it off as minor glitches, but the situation escalated when we found ourselves facing login re-validation requests that essentially locked us out of our crypto wallet—despite entering the correct credentials. Frustrated and anxious, we sought advice from a few friends, only to hit a wall of uncertainty. Turning to the vast expanse of the internet felt daunting, but in doing so, we stumbled upon TECH CYBER FORCE RECOVERY. I approached them with a mix of skepticism and hope; after all, my understanding of these technical matters was quite limited. Yet, from our very first interaction, it was clear that they were the experts we desperately needed. They walked us through the intricacies of the recovery process, patiently explaining each mechanism—even if some of it went over my head, their reassurance was calming. Our responsibility was simple: to provide the correct information to prove our ownership of the crypto account, and thankfully, we remained on point in our responses. in a timely fashion, TECH CYBER FORCE RECOVERY delivered on their promises, addressing all our withdrawal and access issues exactly when they said they would. The relief we felt was immense, and the integrity they displayed made me confident in fully recommending their services. If you ever find yourself in a similar predicament with your crypto investments, I wholeheartedly suggest reaching out to them. You can connect with TECH CYBER FORCE RECOVERY through their contact details for assistance and valuable guidance. Remember, hope is only a reach away!
question