1. 19:17 3rd Nov 2009

    notes: 86

    reblogged from: yoshihide

    僕は今回の案件で、システムのレスポンスに徹底的にこだわってる。

    それには理由がある。

    それは、プログラマの誇りを見せ付けたいからだ。

    この案件は、既存機能をコピーして似た機能を作るというものだ。


    既存機能は、Webシステムなのに1アクションで

    1分や2分以上のレスポンスタイムはザラで、

    悪いときには数分後にタイムアウトして、

    さらに悪いときには、アプリケーション全体をロックしてしまっていた。

    顧客はそれでも我慢して使っていてくれたそうだ。

    今回の改変に、顧客がパフォーマンスを要求するのは当然だった。


    それにしても酷いアリサマだとコードを見てみると

    酷い。

    確かにパフォーマンスは出ないのも無理はない。


    いや、それどころか僕は、このSI業界の問題を感じざるを得なかった。

    この機能はそこそこ難しく、業務的にも重要だ。

    しかし、そのコードは、新人~3年目ぐらいのプログラマが書いたとしか思えないコードだった。


    例えば、

    ・Stringを+でツナギまくってパフォーマンスが激劣化していた。

    ・SQLで、よく考えれば要らないJoinが山ほどあった。

    ・すべてMapで引数を取り回し、Mapの中身はすべてStringに置き換えられていた。

    ・数字もDateもStringだ。

    ・1000行以上もあるSQLは、適切にインデント付けされておらず、読むことすら億劫になる。

    その他、Sessionの使い方、クラス分け、変数名の付け方、コメントの書き方に至るまで、

    新人が試行錯誤して作った跡が見られる。

    この業界の問題、それは

    プログラムが、新人~3年目の作業と位置づけられていることだ。


    僕はこの認識を変えたい。

    だから徹底的に、スキルの差によってどれ程のパフォーマンス差が出るか示したいと思った。

    自慢したいわけではない、

    10年近くコードと真剣に向き合ってきたから、

    新人~3年目に負けるはずはない。

    このコーディングに際して、まず徹底的なリファクタリングから取り掛かった。

    SQLを読みやすくインデント付けし、Mapを取りやめて適切な型のオブジェクトにし、

    StringBufferをつかって、Joinを削った。

    作り直したといっても良い。

    もちろんチューニングは徹底的に行なった。

    実装工数の三分の一を使った。 

    先週まで、1アクション3秒の壁を越えられなかったけど、今日2秒を越えた。

    検索自体は、0.5秒以内。改修前は、早くとも30秒だったので60倍の高速化だ。

    最もパフォーマンス差が出たアクションでは、1000倍以上の差となった。

    これを顧客に納品する。

    今まで、1つ1つのアクションに対してイライラし続けていた機能は、

    サクサクと動くようになる。

    この機能は、サクサク動くと業務上の使い道が大きく広がることは間違いない。


    顧客は感じてくれるだろう。

    サクサク動くことの快感を。

    顧客は疑問に思ってくれるだろう。

    「なぜ既存機能よりも情報量の多い、この機能がこんなに早いのか?」と

    そして問い合わせてくれたら良いと思う。

    なぜこの機能はこんなに早くて、

    他の機能はウンザリするほど遅いのかを。

    そのときには、答える。

    プログラミングスキルの差としか言えませんと。


    新人~3年目が悪いわけじゃない。

    ベテランがコードを書かなさ過ぎる。


    僕のスキル程度は、ザラに居るはず。

    しかし彼らは、設計書のメッセージIDや、設計書更新日付の整合性や

    フォントや罫線の切れを合わせるのに貴重な労力を割きすぎるんだ。

    システム開発は、顧客の要件を実現するサービス業だ。

    要件の実現がキモなのに。

    実装がキモなのに。

    なぜ、ベテランが頭だけやるのか。

    僕にはどう考えても、理解不能だ。

    今回、僕は頭の先から尻尾までやった。

    それが普通であってほしい。

     
    1. 9o7d reblogged this from aguanis
    2. gamsic reblogged this from luft2501
    3. luft2501 reblogged this from gkojay
    4. nacookan reblogged this from shoh
    5. aguanis reblogged this from littlerodem
    6. 0sh1ma reblogged this from takaakik
    7. -nobby- reblogged this from fishandmush
    8. coluli reblogged this from yoshihide
    9. reblogparade reblogged this from girio
    10. tfujiki reblogged this from hanausagi
    11. hanausagi reblogged this from takaakik
    12. littlerodem reblogged this from reretlet
    13. funya reblogged this from mnky
    14. mnky reblogged this from takaakik
    15. jasunari reblogged this from takaakik
    16. girio reblogged this from fishandmush
    17. fishandmush reblogged this from takaakik
    18. yoshihide reblogged this from msz-006
    19. takaakik reblogged this from gkojay
    20. shoh reblogged this from gkojay
    21. sonnamon reblogged this from reretlet
    22. msz-006 reblogged this from reretlet
    23. mski reblogged this from hogefugapiyo
    24. mooljot reblogged this from reretlet
    25. papapantu reblogged this from reretlet
    26. iroha reblogged this from reretlet
    27. iroha reblogged this from reretlet
    28. hogefugapiyo reblogged this from reretlet
    29. reretlet reblogged this from gkojay
    30. f031461a reblogged this from ljmp
    31. shingoy reblogged this from ljmp
    32. ljmp reblogged this from gkojay
    33. gkojay reblogged this from petapeta
    34. dnsystem reblogged this from otsune
    35. pcatan reblogged this from rightstaff
    36. blacktights reblogged this from reretlet
    37. reretlet reblogged this from rightstaff
    38. rightstaff reblogged this from nakano
    39. glinglun reblogged this from zoker
    40. zoker reblogged this from zochi
    41. zochi reblogged this from nakano
    42. ccd reblogged this from nakano
    43. pgtwitter reblogged this from nakano
    44. ishida reblogged this from nakano
    45. nakano reblogged this from kiyoya
    46. ryujisnote reblogged this from gkojax
    47. rightstaff reblogged this from otsune
    48. ethica reblogged this from shayol
    49. alexsakura reblogged this from wozozo
    50. spherical-moss reblogged this from otsune
    51. wozozo reblogged this from mutronix
    52. vmconverter reblogged this from wiggling
    53. send reblogged this from tiga
    54. device302 reblogged this from mutronix
    55. yamarena reblogged this from otsune
    56. wiggling reblogged this from otsune
    57. mug-g reblogged this from otsune
    58. kynbit reblogged this from sakurasakuras
    59. r-k reblogged this from shayol
    60. shayol reblogged this from gkojax
    61. msz-006 reblogged this from sakurasakuras
    62. hsbt reblogged this from otsune
    63. sakurasakuras reblogged this from tiga
    64. tiga reblogged this from otsune
    65. manamanmana reblogged this from otsune
    66. iyoupapa reblogged this from otsune
    67. deductivehappiness reblogged this from 00a
    68. gkojax reblogged this from otsune
    69. yaruo reblogged this from otsune
    70. etoystk reblogged this from otsune
    71. kiyoya reblogged this from otsune
    72. mutronix reblogged this from otsune
    73. 00a reblogged this from yomayoma
    74. otsune reblogged this from ljmp
    75. yomayoma reblogged this from ljmp
    76. ljmp reblogged this from petapeta
    77. petapeta posted this