Re: [XPOST] [C] Access speed: pointers Vs array
From: Il Prof (chiedisulng_at_chiedisulng.org)
Date: 08/05/04
- Next message: Jens.Toerring_at_physik.fu-berlin.de: "Re: [XPOST] [C] Access speed: pointers Vs array"
- Previous message: Il Prof: "Re: [XPOST] [C] Access speed: pointers Vs array"
- In reply to: Eric Sosman: "Re: [XPOST] [C] Access speed: pointers Vs array"
- Next in thread: Jack Klein: "Re: [XPOST] [C] Access speed: pointers Vs array"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 05 Aug 2004 18:03:03 +0200
Eric Sosman <Eric.Sosman@sun.com> wrote:
>The answer isn't useful to
>guide your programming technique, because it will be
>different on different systems -- it will even be
>different on the same system with the same compiler
>in different circumstances.
My objective was only know what string access method is faster in my
platform because i'm developing a personal tool that elaborates millions
of strings.
> Second (pedantic):
Ok, i will remember! :)
>strcopy3() is just plain stupid,
>especially when the author claims to be interested in
>micro-optimization.
There is an error...now i know.
>strcopy4() and strcopy5() have bugs,
Can you help my in find them? Thanks.
>clock() would be a better choice here, although
>it, too, has its problems.
I will use it next time. However I run the code 50 times and I
calculated the average time.
> Fifth: Your compiler should have complained about the
>long string literal with embedded newlines.
I have used gcc...
> Sixth: If you learn what function pointers are and how
>to use them, you can make the "timing harness" code much
>shorter and less repetitive than it now is.
I have explained that was a very simple and "brutal" code. But you are
right.
> You need to run
>the test again and with larger repetition counts to
>determine whether the timing difference is real or is
>merely "jitter."
I run the code 50 times and I calculated the average time.
Thanks for all eight points.
-- Il Prof.
- Next message: Jens.Toerring_at_physik.fu-berlin.de: "Re: [XPOST] [C] Access speed: pointers Vs array"
- Previous message: Il Prof: "Re: [XPOST] [C] Access speed: pointers Vs array"
- In reply to: Eric Sosman: "Re: [XPOST] [C] Access speed: pointers Vs array"
- Next in thread: Jack Klein: "Re: [XPOST] [C] Access speed: pointers Vs array"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|