7月 16th, 2010

配列の初期化パフォーマン゜ (x86_64 memset緜 )

Posted in Linux by admin

 以前、Solaris(Sparc)環? 上ぜ “Sun Studio C Compiler”でコンパイルしたプログラムによる配列の初期化パフォーマン゜ の? 証のところぜ memsetの話題を挙げましたが、64bit Linux(x86_64)環? においても、あるバージョンぜ glibcで同関数パフォーマンスに影響を圏 ぼす可能性が゜ かったので調査してみました。前回同様、1024バイト配列ぜ memset初期化を1,000,000回ループさるプログラムの処理時間で? 較を行いました。また、様々なバイトの配列でも試してみました。以? がその? 果です。

■glibc-2.5-24.x86_64
1024バイト配列:		平均  0.048秒
1024*10バイト配列:		平均  0.436秒
1024*100バイト配列:		平均  6.331秒
1024*117バイト配列:		平均  7.385秒
1024*118バイト配列:		平均 36.644秒
1024*1000バイト配列:	平均304.943秒
■glibc-2.5-42.x86_64
1024バイト配列:		平均 0.029秒
1024*10バイト配列:		平均 0.216秒
1024*100バイト配列:		平均 5.187秒
1024*117バイト配列:		平均 6.074秒
1024*118バイト配列:		平均 6.130秒
1024*1000バイト配列:	平均51.958秒

 上記の? 果のように、glibc-2.5.24のパフォーマンスが2.5.42よりも劣化するということ。更に配列のサイ゜ 1024*118を超えた時点で、パフォーマンスが著しぜ 劣化するという点が挙げられます。おそらぜ 2.5.32以降で対応した修正パッケージとパッチが以? のものだと思゜ れます。memsetのコードは朮 どアセンブラなので、修正内容はあまり理解出来ません。コメントにぜ PIC(Position Independent Code)の文字が見られ、もしかしたらgccオプション「-fPIC」が使用される共有ライブラリでは更に性能が異なるのかもしれません。

http://rhn.redhat.com/errata/RHBA-2009-0080.html
an optimized memset() routine for AMD64 and Intel 64 systems has been added.
glibc-rh437394.patch

2008-08-14  Ulrich Drepper  <drepper@redhat.com>
	* sysdeps/x86_64/memset.S: Reduce size of tables for PIC.
2008-02-26  Harsha Jagasia  <harsha.jagasia@amd.com>
	* sysdeps/x86_64/memset.S: Rewrite non-SSE code path as tuned for AMD
	Barcelona machine.  Make default fall through branch of
	__x86_64_preferred_memory_instruction check as the integer code path.
2007-10-15  Ulrich Drepper  <drepper@redhat.com>
	* sysdeps/x86_64/memset.S: Use __x86_64_shared_cache_size.
	Always define bzero.
	Remove non-glibc code.
You can leave a comment, or trackback from your own site. RSS 2.0

34 comments

  1. canadian online pharmacy says:

    diseases digestive system bronchial asthma causes
    http://canadinpharmacy.us.com/# canadian pharmacies

    1月 9th, 2019 at 7:57:18

  2. canadian pharmacies says:

    what are symptoms of gastro types of food allergies
    http://canadian-drugstore.us.org canadian pharmacies

    1月 10th, 2019 at 16:39:20

  3. canadian online pharmacy says:

    hair replacement options allergic response
    http://canadinpharmacy.us.com/# canadian pharmacies

    1月 10th, 2019 at 18:38:24

  4. canadian pharmacy online says:

    signs of asthma attack ankle arthritis
    http://canadinpharmacy.us.com/# online pharmacy

    1月 12th, 2019 at 9:11:09

  5. online pharmacy says:

    treatment treatment pathology of asthma
    http://onlinedrugstore.us.org canadian pharmacies

    1月 13th, 2019 at 8:21:23

  6. canadian pharmacy says:

    asthma test hair baldness treatment
    http://canadinpharmacy.us.com/# online canadian pharmacy

    1月 14th, 2019 at 8:03:59

  7. canadian pharmacy says:

    how common is asthma osteoarthritis symptoms
    http://onlinedrugstore.us.org canadian pharmacies

    1月 15th, 2019 at 8:34:47

  8. canadian pharmacy says:

    gastrointestinal signs and symptoms what is a gastrointestinal
    http://canadian-drugstore.us.org canadian pharmacies

    1月 17th, 2019 at 8:00:31

  9. canadian pharmacies says:

    arthritis in neck effects of seasonal allergies
    http://onlinedrugstore.us.org online pharmacy

    1月 19th, 2019 at 7:37:35

  10. online pharmacy says:

    gastrointestinal tract disease how to treat drug abuse
    http://canadian-drugstore.us.org canadian pharmacies

    1月 21st, 2019 at 0:05:04

  11. canadian pharmacy says:

    best hair transplant doctor gastrointestinal disease
    http://canadian-drugstore.us.org canadian pharmacy

    1月 24th, 2019 at 6:34:23

  12. canadian pharmacies says:

    causes of arthritis pain types of gastrointestinal disorders
    http://canadian-drugstore.us.org online pharmacy

    1月 25th, 2019 at 23:42:11

  13. canadian pharmacies says:

    can allergies cause cats and allergies
    http://onlinedrugstore.us.org canadian pharmacy

    1月 27th, 2019 at 9:18:33

  14. canadian pharmacies says:

    natural hair loss remedies hair regrowth for men
    http://onlinedrugstore.us.org online pharmacy

    1月 28th, 2019 at 23:01:38

  15. canadian pharmacy says:

    hair loss thyroid osteoarthritis diet
    http://onlinedrugstore.us.org online pharmacy

    1月 30th, 2019 at 22:53:30

  16. canadian pharmacies says:

    hereditary hair loss what can you do for arthritis
    http://onlinedrugstore.us.org online pharmacy

    2月 1st, 2019 at 20:30:09

  17. canadian pharmacy says:

    asthma and its treatment eye allergy test
    http://onlinedrugstore.us.org canadian pharmacies

    2月 4th, 2019 at 7:15:06

  18. online pharmacy says:

    severe allergies seasonal symptoms of upper gi problems
    http://canadian-drugstore.us.org canadian pharmacies

    2月 5th, 2019 at 21:11:43

  19. canadian pharmacies says:

    symptoms from allergies nickel allergy
    http://onlinedrugstore.us.org canadian pharmacy

    2月 7th, 2019 at 5:56:47

  20. canadian pharmacy says:

    what causes arthritis pain severe digestive disorders
    http://onlinedrugstore.us.org canadian pharmacy

    2月 9th, 2019 at 7:44:10

  21. canadian pharmacy online says:

    gastroenterology society git disturbance
    http://onlinedrugstore.us.org canadian pharmacy

    2月 27th, 2019 at 8:49:43

  22. canadian online pharmacy says:

    the symptoms of arthritis lost hair
    http://canadinpharmacy.us.com online canadian pharmacy

    3月 1st, 2019 at 6:16:50

  23. canadian online pharmacy says:

    treatment of breast tumor child hair loss
    http://canadinpharmacy.us.com canadian pharmacy

    3月 3rd, 2019 at 6:36:47

  24. canadian online pharmacy says:

    gastric problem symptoms literary treatment
    http://canadian-drugstore.us.org online pharmacy

    3月 5th, 2019 at 6:29:02

  25. online canadian pharmacy says:

    rheumatism and arthritis losing hair treatment
    http://canadianonlinepharmacy.us.org canadian pharmacy online

    3月 6th, 2019 at 21:28:50

  26. canadian online pharmacy says:

    milk allergy causes of arthritis
    http://canadinpharmacy.us.com canadian online pharmacy

    3月 8th, 2019 at 22:51:21

  27. canadian pharmacy says:

    what are the symptoms of an asthma attack digestive infections
    http://canadianonlinepharmacy.us.org canadian pharmacy online

    3月 10th, 2019 at 21:17:17

  28. online pharmacies says:

    symptoms of seasonal allergies homeopathic asthma treatment
    http://canadinpharmacy.us.com canadian pharmacy

    3月 12th, 2019 at 21:00:39

  29. viagra without a doctor prescription says:

    research on asthma extrinsic asthma
    http://viagrawithoutdoctor.tech viagra without a doctor prescription

    3月 12th, 2019 at 21:50:14

  30. online pharmacies says:

    hair dropping problem rice allergy
    http://canadinpharmacy.us.com online pharmacy

    3月 15th, 2019 at 11:10:13

  31. canadian pharmacy says:

    asthma diagnosis best treatment for
    http://canadinpharmacy.us.com canadian pharmacy

    3月 16th, 2019 at 10:11:06

  32. canadian pharmacies says:

    treatment of hair loss kids food allergies
    http://canadinpharmacy.us.com online pharmacy

    3月 18th, 2019 at 6:07:47

  33. canadian pharmacy says:

    gi intestine skin allergy to pollen
    http://canadinpharmacy.us.com canadian pharmacies

    3月 20th, 2019 at 6:50:09

  34. online pharmacies says:

    allergic reaction symptoms depression
    http://onlinedrugstore.us.org canadian online pharmacy

    3月 24th, 2019 at 0:13:49

Leave a comment