- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I often heard that the use of derived-type variables in big computational procedures was less efficient than the use of variable based on intrinsic types.
However, I do not really know where does the difference appears.
Therefore, I do not know to which extent the use of derived-type variable will not affect the program efficiency.
For example, when accessing data through host association, is it slower if the data is stored in a derived type variable than if it was not ?
Is there a efficiency difference between this implementation
and this one:
Thanks
I often heard that the use of derived-type variables in big computational procedures was less efficient than the use of variable based on intrinsic types.
However, I do not really know where does the difference appears.
Therefore, I do not know to which extent the use of derived-type variable will not affect the program efficiency.
For example, when accessing data through host association, is it slower if the data is stored in a derived type variable than if it was not ?
Is there a efficiency difference between this implementation
[fortran]Module MyModule private public MyType Type :: MyType real, dimenstion(1:10) :: Sub1 real, dimenstion(1:10) :: Sub2 real, dimenstion(1:10) :: Sub3 End Type End Module Program use MyModule ,only: MyType End Program[/fortran]
and this one:
[fortran]Module MyModule private public Sub1, Sub2, Sub3 real, dimenstion(1:10) :: Sub1 real, dimenstion(1:10) :: Sub2 real, dimenstion(1:10) :: Sub3 End Module Program use MyModule ,only: Sub1, Sub2, Sub3 End Program[/fortran]
Thanks
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Host association is resolved at compile-time, and should not have an effect on performance. I think also that it is an overly broad generalization to say that derived types hurt performance. A lot depends on how you use them, especially if you have arrays of derived type and try to use non-contiguous arrays of components.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page