Coding Challenge 4!

The Partridge Family were neither partridges nor a family. Discuss.
Pindrought
Posts: 432
Joined: September 26th, 2013, 4:57 pm
Location: Kentucky
Contact:

Re: Coding Challenge 4!

Post by Pindrought » September 22nd, 2018, 9:51 pm

paulboon wrote:i'm getting tons of error messages when opening the project
stuff like
cannot open source file "conio.h"
and
namespace "std" has no member "filesystem"

do i have some setting wrong in visual studio or am i using the wrong version of visual studio(using 2017)?
I had those issues with VS 2015, but I am not experiencing them on VS 2017.
PM me if you need to contact me. Thanks to all the helpful people on this forum especially to Chili.

User avatar
Yumtard
Posts: 575
Joined: January 19th, 2017, 10:28 pm
Location: Idiot from northern Europe

Re: Coding Challenge 4!

Post by Yumtard » September 22nd, 2018, 10:13 pm

^ update to latest version of visual studio


@NightFighter
I got about 49ms on your latest test.

I'm assuming chilly will be talking nano seconds when it comes to his solution. Might look into ways to optimize this during the week if I get the time. Optimization sorcery is not my strong suit tho

paulboon
Posts: 14
Joined: February 11th, 2017, 3:02 pm

Re: Coding Challenge 4!

Post by paulboon » September 22nd, 2018, 10:15 pm

it seems to have to do something with the external dependencies folder(filter) not getting properly included
how do i fix that?

paulboon
Posts: 14
Joined: February 11th, 2017, 3:02 pm

Re: Coding Challenge 4!

Post by paulboon » September 22nd, 2018, 10:16 pm

trying to update right now seeing if that helps

paulboon
Posts: 14
Joined: February 11th, 2017, 3:02 pm

Re: Coding Challenge 4!

Post by paulboon » September 22nd, 2018, 10:53 pm

updating fixed it, thank you yumtard

NightFighter
Posts: 8
Joined: September 22nd, 2018, 6:32 pm
Location: United Kingdom

Re: Coding Challenge 4!

Post by NightFighter » September 22nd, 2018, 11:02 pm

Well on my third attempt at coding it I get

Code: Select all

PASS (12.17ms) File Test: Buck Futter's Sexy Test 1
PASS (6.59ms) File Test: Buck Futter's Sexy Test 2
PASS (6.28ms) File Test: Buck Futter's Sexy Test 3
PASS (5.15ms) File Test: Buck Futter's Sexy Test 4
PASS (5.61ms) File Test: Buck Futter's Sexy Test 5
PASS (5.96ms) File Test: Buck Futter's Sexy Test 6
PASS (359.39ms) File Test: NF Test
PASS (280.43ms) File Test: NF Test 2
it's not bad, but nowhere near what you are getting :(
I think I'll throw in the towel now.
[Edit]
does chili's cpu run things faster with 4 threads or 8 threads; because it is a quad core cpu but it has 8 logical processors

Pindrought
Posts: 432
Joined: September 26th, 2013, 4:57 pm
Location: Kentucky
Contact:

Re: Coding Challenge 4!

Post by Pindrought » September 22nd, 2018, 11:17 pm

Uh oh got a speed boost!

Just need a little more to beat Yumtard.

Image
PM me if you need to contact me. Thanks to all the helpful people on this forum especially to Chili.

Pindrought
Posts: 432
Joined: September 26th, 2013, 4:57 pm
Location: Kentucky
Contact:

Re: Coding Challenge 4!

Post by Pindrought » September 22nd, 2018, 11:56 pm

NightFighter wrote:Well on my third attempt at coding it I get

Code: Select all

PASS (12.17ms) File Test: Buck Futter's Sexy Test 1
PASS (6.59ms) File Test: Buck Futter's Sexy Test 2
PASS (6.28ms) File Test: Buck Futter's Sexy Test 3
PASS (5.15ms) File Test: Buck Futter's Sexy Test 4
PASS (5.61ms) File Test: Buck Futter's Sexy Test 5
PASS (5.96ms) File Test: Buck Futter's Sexy Test 6
PASS (359.39ms) File Test: NF Test
PASS (280.43ms) File Test: NF Test 2
it's not bad, but nowhere near what you are getting :(
I think I'll throw in the towel now.
[Edit]
does chili's cpu run things faster with 4 threads or 8 threads; because it is a quad core cpu but it has 8 logical processors
From my testing, I had the best results from utilizing 8 threads for the i7 4770k.

Looks like i''m done for now. These are my final results.

Image
PM me if you need to contact me. Thanks to all the helpful people on this forum especially to Chili.

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: Coding Challenge 4!

Post by chili » September 23rd, 2018, 3:39 am

@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 ;)
Chili

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: Coding Challenge 4!

Post by chili » September 23rd, 2018, 3:45 am

For heavy tests, instead of generating and loading giant files my recommendation is inherit from TestCase and make a test case that fills a vector in memory without need to access any file. Faster and easier than writing separate code to generate the data set file in the first place :D
Chili

Post Reply