- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Does the use of allocate affect the speed of the program, compared to using static alloated matrices?
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It can, but a lot will depend on the program. Many programs won't see a difference. The major issue is what information the compiler can see about the bounds of the array, and where it has to get it from. We've done a lot of work to optimize this, so I would not hesitate to use allocatable arrays where they make sense.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It will affect some types of coding practices but not others. Many large-ish applications have dozens or hundreds of program modules. These modules are typicaly passed references to an array or to a portion of an array.
The call may suffer a tiny hit but if the subroutine performs a lot of work then it is dereferencing the dummy argument and these should work as fast as they did before (unless DIMENSION'ed with (*)).
Jim Dempsey

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