type绑定的子程序比一般子程序计算的要慢很多
大家好,我分别调用type里面绑定的子程序和一般的子程序进行计算,发现前者要比后者慢很多,检查后没有找到问题在哪,向大家求助计算时间为:1.26 s
0.702 s
我的计算平台:Windows 7 + ifort 2017 + VS2015 community
附件为代码,谢谢各位
慢很多并不稀奇,譬如这个帖子
Speed loss using object oriented features !!!
https://software.intel.com/en-us/forums/intel-visual-fortran-compiler-for-windows/topic/394378
performance - Speed of dereferencing class properties in fortran - Stack Overflow
https://stackoverflow.com/questions/24326157/speed-of-dereferencing-class-properties-in-fortran
btw,OOP不是免费午餐,总得有所付出,就看是否值得 谢谢,我去研究研究!:-)
页:
[1]