<60 seconds
-
I've come up with an algorithm that determines the 26656 solutions in less than 60 seconds for this.[^] It's really quite a fun problem to work on in one's spare time. Any more takers? It'd be neat to get some other contributors. I'm not in it for the VB vs. C# thing, I just love these kind of problems. Marc MyXaml Advanced Unit Testing YAPO
When can we expect the article, Marc? ;) Seriously though...under a minute? On what hardware?
[Cheshire] I can't afford those plastic things to cover the electric sockets so I just draw bunny faces on the electric outlets to scare the kids away from them... [RLtim] Newsflash! Kids aren't afraid of bunnies. [Cheshire] Oh they will be... -Bash.org
-
When can we expect the article, Marc? ;) Seriously though...under a minute? On what hardware?
[Cheshire] I can't afford those plastic things to cover the electric sockets so I just draw bunny faces on the electric outlets to scare the kids away from them... [RLtim] Newsflash! Kids aren't afraid of bunnies. [Cheshire] Oh they will be... -Bash.org
David Stone wrote: When can we expect the article, Marc? I'm writing it this weekend. :-D David Stone wrote: Seriously though...under a minute? On what hardware? A 2.8Ghz P4 with Hyperthreading. My previous best time was around 30 minutes. Imagine my shock when the algorithm change I made resulted in this difference. I figured it would be an improvement, but not THAT significant! So, regardless of the machine performance, going from 30 minutes to about 40 seconds (turning off GUI updates) is pretty amazing. Marc MyXaml Advanced Unit Testing YAPO
-
David Stone wrote: When can we expect the article, Marc? I'm writing it this weekend. :-D David Stone wrote: Seriously though...under a minute? On what hardware? A 2.8Ghz P4 with Hyperthreading. My previous best time was around 30 minutes. Imagine my shock when the algorithm change I made resulted in this difference. I figured it would be an improvement, but not THAT significant! So, regardless of the machine performance, going from 30 minutes to about 40 seconds (turning off GUI updates) is pretty amazing. Marc MyXaml Advanced Unit Testing YAPO
going from 30 minutes to about 40 seconds (turning off GUI updates) is pretty amazing. Oh yeah, definitely. Synchronous GUI updates in a tight algorithm are a bad idea, IMO. Painting takes so freaking long compared to the mathematical analysis that is involved in an algorithm that it bogs down considerably. I noticed that in the original sample. When I had it updating the GUI it was running dog slow. I ripped out the GUI update code and it ran a whole heck of a lot faster. But not enough to complete in 40 seconds. I'm looking forward to seeing how you did it. :)
[Cheshire] I can't afford those plastic things to cover the electric sockets so I just draw bunny faces on the electric outlets to scare the kids away from them... [RLtim] Newsflash! Kids aren't afraid of bunnies. [Cheshire] Oh they will be... -Bash.org
-
David Stone wrote: When can we expect the article, Marc? I'm writing it this weekend. :-D David Stone wrote: Seriously though...under a minute? On what hardware? A 2.8Ghz P4 with Hyperthreading. My previous best time was around 30 minutes. Imagine my shock when the algorithm change I made resulted in this difference. I figured it would be an improvement, but not THAT significant! So, regardless of the machine performance, going from 30 minutes to about 40 seconds (turning off GUI updates) is pretty amazing. Marc MyXaml Advanced Unit Testing YAPO
Yeah, I always recall a similar story in a C++ book I read, where a guy spent ages optimising code, to get a small improvement, then he rethought the algorithm and without optimisations, blew the old code out of the water. Christian I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
-
I've come up with an algorithm that determines the 26656 solutions in less than 60 seconds for this.[^] It's really quite a fun problem to work on in one's spare time. Any more takers? It'd be neat to get some other contributors. I'm not in it for the VB vs. C# thing, I just love these kind of problems. Marc MyXaml Advanced Unit Testing YAPO
-
going from 30 minutes to about 40 seconds (turning off GUI updates) is pretty amazing. Oh yeah, definitely. Synchronous GUI updates in a tight algorithm are a bad idea, IMO. Painting takes so freaking long compared to the mathematical analysis that is involved in an algorithm that it bogs down considerably. I noticed that in the original sample. When I had it updating the GUI it was running dog slow. I ripped out the GUI update code and it ran a whole heck of a lot faster. But not enough to complete in 40 seconds. I'm looking forward to seeing how you did it. :)
[Cheshire] I can't afford those plastic things to cover the electric sockets so I just draw bunny faces on the electric outlets to scare the kids away from them... [RLtim] Newsflash! Kids aren't afraid of bunnies. [Cheshire] Oh they will be... -Bash.org
Output heavy console applications can be a pig on laptop hardware too. Quite amusing resizing a console window and speeding up an app by at least 300%. Ryan.
-
zarzor wrote: Are you still alive Marc? No, I am speaking to you from the spiritual world! woooo oooooo boo! :-D Marc MyXaml Advanced Unit Testing YAPO
-
I've come up with an algorithm that determines the 26656 solutions in less than 60 seconds for this.[^] It's really quite a fun problem to work on in one's spare time. Any more takers? It'd be neat to get some other contributors. I'm not in it for the VB vs. C# thing, I just love these kind of problems. Marc MyXaml Advanced Unit Testing YAPO
Oh come on, how can you talk an article seriously that says this... "Perhaps it is to compensate the fact that C# are probably not as good a VB programmers are." :) Jeremy Falcon
-
Oh come on, how can you talk an article seriously that says this... "Perhaps it is to compensate the fact that C# are probably not as good a VB programmers are." :) Jeremy Falcon
Jeremy Falcon wrote: Oh come on, how can you talk an article seriously that says this... Still, I decided that it would be fun project on the merits of the exercise, not the underlying motivations. Then again, if I can blow the pants of any VB implementation, who am I to complain? :~ (I better not screw up, eh?) Marc MyXaml Advanced Unit Testing YAPO
-
Jeremy Falcon wrote: Oh come on, how can you talk an article seriously that says this... Still, I decided that it would be fun project on the merits of the exercise, not the underlying motivations. Then again, if I can blow the pants of any VB implementation, who am I to complain? :~ (I better not screw up, eh?) Marc MyXaml Advanced Unit Testing YAPO
Marc Clifton wrote: Then again, if I can blow the pants of any VB implementation, who am I to complain? That's the spirit! I'm looking forward to the article. :) Jeremy Falcon
-
I've come up with an algorithm that determines the 26656 solutions in less than 60 seconds for this.[^] It's really quite a fun problem to work on in one's spare time. Any more takers? It'd be neat to get some other contributors. I'm not in it for the VB vs. C# thing, I just love these kind of problems. Marc MyXaml Advanced Unit Testing YAPO
So you obviously have a good new algorithm at work. The guts to me is the less brute force that you rely on the better. Imagine if you could rather calculate the positions than search for them. Regardz Colin J Davies The most LinkedIn CPian (that I know of anyhow) :-)
-
zarzor wrote: Are you still alive Marc? No, I am speaking to you from the spiritual world! woooo oooooo boo! :-D Marc MyXaml Advanced Unit Testing YAPO
No, I am speaking to you from the spiritual world! woooo oooooo boo! Or as Zaphod would say "No - I just haven't stopped moving yet" :-D "I think I speak on behalf of everyone here when I say huh?" - Buffy
-
Output heavy console applications can be a pig on laptop hardware too. Quite amusing resizing a console window and speeding up an app by at least 300%. Ryan.
Ryan Roberts wrote: Output heavy console applications can be a pig on laptop hardware too. Quite amusing resizing a console window and speeding up an app by at least 300%. Next time, press Alt-Enter and enter full screen mode. This will put you at text mode, instead of Graphics mode. The video hardware is much faster at drawing chars and scrolling areas than Windows, because you'll be now at text mode. I see dead pixels Yes, even I am blogging now!
-
Yeah, I always recall a similar story in a C++ book I read, where a guy spent ages optimising code, to get a small improvement, then he rethought the algorithm and without optimisations, blew the old code out of the water. Christian I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
Christian Graus wrote: Yeah, I always recall a similar story in a C++ book I read, where a guy spent ages optimising code, to get a small improvement, then he rethought the algorithm and without optimisations, blew the old code out of the water. I've done exactly this myself. Worked on a project with a C++ server application taking in excess of 26 hours for a single run - which was a tad too much as the application had to run once a day (yes, it processed an awful lot of data). By applying all kinds of tricks - a few of them rendering parts of the code almost impossible to maintain for future developers, I might add, I shaved away 2 hours of the running time. Hm, not good enough. Time to rethink - I started from scratch, and instead of trying to optimize the existing application, I though about what the application was expected to do instead - not thinking of how to solve details. Redoing the complete structure from scratch, completely changing the process, I was of course very exited when it came to the first test run... 20 minutes. The rewrite took a fraction of the time I had spent on optimization.