Benchmark for some string operations.






Misc >
Help >
FAQ >


Links >



Benchmark for some string operations.

This program benchmarks the following operations:

  • strcpy,
  • strlen,
  • strcat,
  • strcmp,
  • strrchr,
  • memcpy,
  • memcmp,
  • strstr.
Source file: bench-string.c
Name Time Ticks
Empty bench (correction) 8 us [17]
strcpy length 1 51 us [103]
strcpy length 16 209 us [419]
strcpy length 32 377 us [755]
strcat length 1 59 us [119]
strcat length 17 225 us [451]
strcat length 33 321 us [643]
strlen length 1 47 us [94]
strlen length 17 231 us [462]
strlen length 33 415 us [830]
strcmp length 33, -1 116 us [232]
strrchr at 17 718 us [1436]
strstr at 16 3864 us [7728]

Copyright (C) 1999, 2000, 2001, 2002, 2003 Stéphane Carrez, France
Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.


AltStyle によって変換されたページ (->オリジナル) /