標題: 個體導向程式架構及機能在不同C++編譯器下之執行效率分析
The analysis of the execution efficiency of Object-Oriented pro- gramming constructs and mechanisms under different C++ compilers
作者: 涂耀仁
Yaw-Ren Tuw
陳登吉
Deng-Jyi Chen
資訊科學與工程研究所
關鍵字: No
公開日期: 1992
摘要: 個體導向程式語言主要包含四項程式架構及機能-資料隱藏, 資料抽象 化, 繼承, 動態繫結. 本文是對個體導向程式語言C++, 分別針對個體導 向之四項程式架構及機能, 相對於傳統的程式設計方式作程式執行效率影 響的分析與探討.我們以C++程式語言分別完成具有上述四項機能的特性 之程式, 並與具有相同功能但以傳統的方式完成之程式作效率的比較. 因 為編譯器的選擇影響執行效率很大, 為求分析結果具有概括性, 故我們使 用六種編譯器 --三種屬於PC上的編譯器, 三種屬於工作站上的, 並分 析此六種編譯器所產生的結果, 以比較不同C++編譯器間有何差異. 從分 析我們得到的結論是:使用繼承之特性對執行效率完全沒有影響,而其它項 的機能特性並不一定會造成執行效率變差, 且改進部份編譯器對上述之機 能的完成方式, 還可以再增進其執行效率. 故使用個體導向方式發展軟 體, 並以個體導向程式語言C++來編寫程式並不意謂程式之執行效率將因 而降低. Object-Oriented programming languages consist of four pro- gramming constructs and mechanisms, namely information hindding, data abstraction, inheritance, dynamic binding. The purpose of this study is to analyze the execution efficiency of Object- Oriented programming constructs and mechanisms under defferent C++ compilers. We implement programs using C++ and each of them has one or more property of the four mechanisms mentioned above. Then we compare them with those programs that have the same functiona- lity but are implemented with traditional programming technigue. Since compilers may produce results of the analysis considerable differences, six kinds of compilers are used to minimize the effects from compilers. These compilers are 1) Borland C++, 2) Zortech C++, 3) MicroSoft C++, 4) SUN gcc version 2.3.3, 5) SUN C++ version 2.1 SC 1.0 and 6) SUN C++ version 2.0 FCS. The first three compilers are for PC environment while the later three are for workstation. From our study, inheritance does not affect on the execution efficiency while the other three machanisms may not always de- crease the execution efficiency. Further studies indicate that appropriate compiler optimization will improve the execution efficiency of these Object-Oriented constructs and mechanisms. Conclusion from this study favors that Object-Oriented con- structs and mechanisms implemented based on C++ do not decrease execution efficiency.Particularly, dynamic binding for some spe- cific applications could outperform the traditional implementa- tion technigue both the execution efficiency and flexibility for implementation.
URI: http://140.113.39.130/cdrfb3/record/nctu/#NT810392047
http://hdl.handle.net/11536/56777
顯示於類別:畢業論文