Thread: Vector vs. array V2.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by iMalc View Post
    Simple. It means you screwed up the test. Something like an extra zero on the upper bound of one of the loops would do it...
    But it's the same loop that does the work for all variants of the classes (unless the code has been changed from what I posted, of course).

    I think the problem has to do with the range checking (but how it can be 10x slower is a bit surprising).

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  2. #2
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545
    I tried adding #define _SECURE_SCL 0 before all my #include directives too and that got the vector time down by a huge amount, but it was still about 50% higher than the others.
    I wonder if there's a difference between VC++ retail vs VC++ express? I no longer have a professional version that I can test it with -- only the express version.
    "I am probably the laziest programmer on the planet, a fact with which anyone who has ever seen my code will agree." - esbo, 11/15/2008

    "the internet is a scary place to be thats why i dont use it much." - billet, 03/17/2010

  3. #3
    Registered User
    Join Date
    Aug 2008
    Posts
    188
    Quote Originally Posted by cpjust View Post
    I tried adding #define _SECURE_SCL 0 before all my #include directives too and that got the vector time down by a huge amount, but it was still about 50% higher than the others.
    I wonder if there's a difference between VC++ retail vs VC++ express? I no longer have a professional version that I can test it with -- only the express version.
    i couldn't get it working in VS2005. it worked in VS2008, could just be a bug or something.

  4. #4
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545
    Quote Originally Posted by bling View Post
    i couldn't get it working in VS2005. it worked in VS2008, could just be a bug or something.
    Why didn't it work? Compile error or runtime error...?
    "I am probably the laziest programmer on the planet, a fact with which anyone who has ever seen my code will agree." - esbo, 11/15/2008

    "the internet is a scary place to be thats why i dont use it much." - billet, 03/17/2010

  5. #5
    Registered User
    Join Date
    Aug 2008
    Posts
    188
    Quote Originally Posted by cpjust View Post
    Why didn't it work? Compile error or runtime error...?
    the _SECURE_CTL flag got ignored, so the vector results sucked.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 16
    Last Post: 05-29-2009, 07:25 PM
  2. from 2D array to 1D array
    By cfdprogrammer in forum C Programming
    Replies: 17
    Last Post: 03-24-2009, 10:33 AM
  3. [question]Analyzing data in a two-dimensional array
    By burbose in forum C Programming
    Replies: 2
    Last Post: 06-13-2005, 07:31 AM
  4. Unknown Memory Leak in Init() Function
    By CodeHacker in forum Windows Programming
    Replies: 3
    Last Post: 07-09-2004, 09:54 AM
  5. Quick question about SIGSEGV
    By Cikotic in forum C Programming
    Replies: 30
    Last Post: 07-01-2004, 07:48 PM