Page 2 of 12 FirstFirst 1234567 ... LastLast
Results 11 to 20 of 113

Thread: Counting

  1. #11
    Resident EE mtekk's Avatar
    Join Date
    Dec 2007
    Location
    Minnesota
    Posts
    469

    Default Re: Counting

    So we're incrementing here correct? I'm not sure if multi-threading will help at all ... Also for timing, are we just benchmarking how long it takes to count from 0 to upper bound specified (1 Million, 2 Million, 5 Million, 10 Million, 1 Billion) incrementing with a step of 1? I could write this in C for the pic 18f452, but it wouldn't set any records here (40Mhz chip). How are you benchmarking things here? time to exit, or is the program supposed to keep track of this?

    Anyways on a 3.2Ghz P4 I'm getting with C++ (MS VC++ 2005 express), no real optimizations:
    1M: 2.406sec
    2M: 4.937sec
    5M: 12.437sec
    10M: 24.797sec
    1000M: 713.672sec
    I'm not sure if the function I'm using for timing is getting me accurate measurements, the resolution of it isn't very great as far as I can tell as it doesn't like measuring things that take too far under a few thousand ICs
    Quote Originally Posted by xRyokenx View Post
    ...I'm getting tired of not being able to figure this crap out because it's apparently made for computer-illiterate people by computer-illiterate people. lol

  2. #12
    Resident EE mtekk's Avatar
    Join Date
    Dec 2007
    Location
    Minnesota
    Posts
    469

    Default Re: Counting

    Same code as before but on my Laptop (C2D x9000 (2.8Ghz )) on vista, still no major optimizations.
    1M: 1.198sec
    2M: 2.276sec
    5M: 5.763sec
    10M: 11.539sec
    1000M: 349.184sec

    Still seems to be a problem with the 1 billion one, but time wise, my laptop is about 2x faster, with Vista than my desktop with XP. I think what happens is I run out of memory, I have 2GB on the laptop and it ate up more than 600MB, on the desktop it stopped eating at 300MB. For all practical purposes the 1 billion one is too large.
    Quote Originally Posted by xRyokenx View Post
    ...I'm getting tired of not being able to figure this crap out because it's apparently made for computer-illiterate people by computer-illiterate people. lol

  3. #13
    Fox Furry crenn's Avatar
    Join Date
    Apr 2005
    Location
    In the shadows behind you
    Posts
    4,067

    Default Re: Counting

    Seems someone wants my assignment code

    For everyone's information, the code won't really help you do this task.
    Antec Sonata II | Pioneer DVR-212
    Good news! You can follow my website or follow me on twitter!

  4. #14
    Overclocking Guru Trace's Avatar
    Join Date
    Aug 2007
    Location
    California
    Posts
    2,077

    Default Re: Counting

    I figured that C++ would beat out VB6 no problem. I'm going to try my hand at Java and see what I can come up with. Do we have an "Official" end to this contest?
    Quote Originally Posted by Lothair View Post
    I guess it's just widely used and has had some of the best people in the world work on it, costing a ridiculous amount of money, for no actual reason. :/
    Have you checked out the front page lately?
    Projects:
    Moe's Tavern | Sponsored by: Mimo Monitors, Crucial, Thermaltake
    Book Of Knowledge

  5. #15
    Resident EE mtekk's Avatar
    Join Date
    Dec 2007
    Location
    Minnesota
    Posts
    469

    Default Re: Counting

    Quote Originally Posted by crenn View Post
    Seems someone wants my assignment code

    For everyone's information, the code won't really help you do this task.
    So what was your assignment?

    Anyways I know my code was a little slower than what's possible, but it will give just about the shortest total application run time (if that even matters). I have a few tricks I can pull, though they all have diminishing returns.
    Quote Originally Posted by xRyokenx View Post
    ...I'm getting tired of not being able to figure this crap out because it's apparently made for computer-illiterate people by computer-illiterate people. lol

  6. #16

    Default Re: Counting

    I just had to do it after my last "submission":

    Code:
    +00000000+++000000++++++0000++++++++000000+++++++++++++++++++++++++++++>
    ++++00++++++0+++++0++++0++++0++++++0++++++0+++++++++++++>
    ++++00++++++0+++++0+++0+++++++++++++0+>++++++++++[<<<
    ----00------000000----0--------------000-----------------------------[
    ++++00++++++0+++++0+++0+++++++++++++++++0+++++++++++++++++++++++>.<.>>.<<
    ----00------0-----0----0----0------------0----------------------]>+<
    ++++00++++++000000++++++0000++++++++00000+++++++++++++++++++++++>>>-]

    Another great program, but this one only counts from to 99, I didn't feel like going any further.
    Anyone want to guess the language? (Hint: its probably what you are thinking when you look at this code)

    @indy: yes, I hope to be more than a hobbyist, I'm most of the way through a BS/MS in Comp Sci, and yes, I've heard about such coding competitions.
    I'm not creative enough to think of a funny sig. Just quietly laugh to yourself and I'll be happy.

  7. #17
    Fox Furry crenn's Avatar
    Join Date
    Apr 2005
    Location
    In the shadows behind you
    Posts
    4,067

    Default Re: Counting

    Quote Originally Posted by mtekk View Post
    So what was your assignment?

    Anyways I know my code was a little slower than what's possible, but it will give just about the shortest total application run time (if that even matters). I have a few tricks I can pull, though they all have diminishing returns.
    Read values from a file, dynamically allocates memory, does some calculations with it (according to the assignment) and prints calculated information on the screen. It's about 60% done.
    Antec Sonata II | Pioneer DVR-212
    Good news! You can follow my website or follow me on twitter!

  8. #18
    Overclocking Guru Trace's Avatar
    Join Date
    Aug 2007
    Location
    California
    Posts
    2,077

    Default Re: Counting

    I see "TBCS" in the code.
    No idea what language though
    I've got a Java code working that does to 1000000000 quite quickly. Only displays the last number though. I also have to get file writing correctly.

    I have a WORKING Java program that accepts input from the user as to which number to count to! This is a big accomplishment for me, considering I started earlier today on Java. It doesn't write them to a file but if you look at my Screenshot below you will notice it runs quite quickly. Without file writing, it will run quite quickly. File writing is what takes the time.

    Screenshot to 1 Billion:

    Last edited by Trace; 04-05-2008 at 08:34 PM. Reason: Added screen shot
    Quote Originally Posted by Lothair View Post
    I guess it's just widely used and has had some of the best people in the world work on it, costing a ridiculous amount of money, for no actual reason. :/
    Have you checked out the front page lately?
    Projects:
    Moe's Tavern | Sponsored by: Mimo Monitors, Crucial, Thermaltake
    Book Of Knowledge

  9. #19
    Fox Furry crenn's Avatar
    Join Date
    Apr 2005
    Location
    In the shadows behind you
    Posts
    4,067

    Default Re: Counting

    Something doesn't quite seem right with that program.
    Antec Sonata II | Pioneer DVR-212
    Good news! You can follow my website or follow me on twitter!

  10. #20
    Overclocking Guru Trace's Avatar
    Join Date
    Aug 2007
    Location
    California
    Posts
    2,077

    Default Re: Counting

    It doesn't output to a file, I wish I could get it to.

    If you want the source, PM me
    Quote Originally Posted by Lothair View Post
    I guess it's just widely used and has had some of the best people in the world work on it, costing a ridiculous amount of money, for no actual reason. :/
    Have you checked out the front page lately?
    Projects:
    Moe's Tavern | Sponsored by: Mimo Monitors, Crucial, Thermaltake
    Book Of Knowledge

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •