Results 1 to 5 of 5

Thread: string class

  1. #1

    Thread Starter
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    string class

    What about speed issues when using the string class, can I use it in game programming or do I have to use C-style strings?
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    string classes always have at least some overhead, but mainly thinking in line of strings, will make you loose your perspective of performance. That's the main reason why I avoid them.

    What kind of game are you making and where do you want to have the strings?
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  3. #3

    Thread Starter
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    I'm not making any kind of game at the moment, I'm reading a book about game programming. I just wanted to know.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  4. #4
    jim mcnamara
    Guest
    We do things like sort 500MB files or search 35 million records.
    In that kind of environment, any extra ovehead is bad news.

    One way to estimate the relative speed of code blocks is to compile different versions of the same algorithm with the flag set to make asm source listings. The number of lines of generated asm code gives you an approximate idea of relatively how slow or fast the code will run. Really only useful if if you are comparing similar algorithms.

  5. #5
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Originally posted by jim mcnamara
    We do things like sort 500MB files or search 35 million records.
    In that kind of environment, any extra ovehead is bad news.

    One way to estimate the relative speed of code blocks is to compile different versions of the same algorithm with the flag set to make asm source listings. The number of lines of generated asm code gives you an approximate idea of relatively how slow or fast the code will run. Really only useful if if you are comparing similar algorithms.
    How do I set the flags to generate asm listings in VC++6?
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

Posting Permissions

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



Click Here to Expand Forum to Full Width