Page 4 of 10

Re: Coding Challenge 4!

Posted: September 23rd, 2018, 5:06 am
by Pindrought
chili wrote:@yum

Yeah, the base fast algo is very simple indeed, so it's highly possible that you missed nothing and just submitted the expected solution.

And I don't think you'll be disappointed by the optimizations ;)
Can't wait to see what you came up with. I remember the last coding challenge I participated in I was pretty amazed by the speeds you achieved.

Re: Coding Challenge 4!

Posted: September 23rd, 2018, 6:50 am
by colencon

Code: Select all

PASS (0.01ms) File Test: Buck Futter's Sexy Test 1
PASS (0.01ms) File Test: Buck Futter's Sexy Test 2
PASS (0.01ms) File Test: Buck Futter's Sexy Test 3
PASS (0.00ms) File Test: Buck Futter's Sexy Test 4
PASS (0.00ms) File Test: Buck Futter's Sexy Test 5
PASS (0.00ms) File Test: Buck Futter's Sexy Test 6
PASS (436.93ms) File Test: NF Test
PASS (359.87ms) File Test: NF Test 2
i have 150ms for 8m, i though with 80m i need 1500ms, and will fail the test. Phew!!!

Re: Coding Challenge 4!

Posted: September 23rd, 2018, 7:47 am
by NightFighter
Well I updated my code and get

Code: Select all

PASS (0.67ms) File Test: Buck Futter's Sexy Test 1
PASS (0.08ms) File Test: Buck Futter's Sexy Test 2
PASS (0.35ms) File Test: Buck Futter's Sexy Test 3
PASS (0.38ms) File Test: Buck Futter's Sexy Test 4
PASS (0.08ms) File Test: Buck Futter's Sexy Test 5
PASS (0.08ms) File Test: Buck Futter's Sexy Test 6
PASS (134.40ms) File Test: NF Test
PASS (138.44ms) File Test: NF Test
PASS (136.20ms) File Test: NF Test
PASS (106.63ms) File Test: NF Test 2
PASS (97.65ms) File Test: NF Test 2
PASS (94.29ms) File Test: NF Test 2
Funnaly my algorithm actually runs faster on one core than 4, so all my knowledge of std::thread and std::async didn't help me in this challenge :(

Re: Coding Challenge 4!

Posted: September 23rd, 2018, 7:52 am
by Slidy
Here are my results:

Code: Select all

PASS (0ms) File Test: Buck Futter's Sexy Test 1
PASS (0.000928ms) File Test: Buck Futter's Sexy Test 2
PASS (0ms) File Test: Buck Futter's Sexy Test 3
PASS (0ms) File Test: Buck Futter's Sexy Test 4
PASS (0ms) File Test: Buck Futter's Sexy Test 5
PASS (0.000464ms) File Test: Buck Futter's Sexy Test 6
PASS (0.006492ms) File Test: Slidy's Test (10,000 nums)
PASS (0.064ms) File Test: Slidy's Test (100,000 nums)
PASS (0.509219ms) File Test: Slidy's Test (800,000 nums)
PASS (6.13659ms) File Test: Slidy's Test (8,000,000 nums)
PASS (53.0116ms) File Test: NF Test
PASS (42.382ms) File Test: NF Test 2
I'm not sure if our results are comparable since we're all running on different machines.
As for the multithreading thing I got the same results. Doing this on a single thread with a good algo beat out a different approach with multiple threads.

Re: Coding Challenge 4!

Posted: September 23rd, 2018, 8:22 am
by FinalL
generating a 80M testfile takes like 10 minutes of proper cooking for me :D

Re: Coding Challenge 4!

Posted: September 23rd, 2018, 8:50 am
by chili
Keep in mind, you might still pass if you're close to 1000ms, depending on your computer's speed relative to mine :)

Re: Coding Challenge 4!

Posted: September 23rd, 2018, 1:09 pm
by Yordrar
i'm seeing a lot of people use threads in their programs but the challenge states that we can only use stdlib and the compiler stuff so, am i missing something or what?

Re: Coding Challenge 4!

Posted: September 23rd, 2018, 2:37 pm
by Yumtard
std::thread

Re: Coding Challenge 4!

Posted: September 23rd, 2018, 3:05 pm
by NightFighter
Yumtard wrote:std::thread
there is also std::async in <future> (witch I find from minor testing launches and closes faster)

Re: Coding Challenge 4!

Posted: September 23rd, 2018, 5:56 pm
by chili
std::async uses thread pools in most impls, so it tends to be more agile.