Re: Fast access multi-dimensional arrays? (int type)
- From: Patricia Shanahan <pats@xxxxxxx>
- Date: Wed, 14 Sep 2005 07:43:54 GMT
Kevin wrote:
Hi all, I have a question of: is there any way we can create a multi-dimensional arrays data structure, each grid item is a "int", with fast access for operations like "increase value in one grid", or get that value?
Does the total matrix size fit easily in cache? If you have only a two-dimensional problem, with 4 to 10 elements in each dimension, obviously the problem does fit.
If yes, then index arithmetic is probably the place to look for improvements.
If no, then you need to think of your problem in terms of transfers between memory and cache. Relationships between the order of access in loops and the order of placement in memory matter. Generally, you want the innermost loop to scan the dimension that is consecutive in memory.
Patricia .
- Follow-Ups:
- Re: Fast access multi-dimensional arrays? (int type)
- From: Roedy Green
- Re: Fast access multi-dimensional arrays? (int type)
- Prev by Date: Re: Location of JDK header files (for JNI code)
- Next by Date: Re: How to struct this kind of application?
- Previous by thread: Re: Fast access multi-dimensional arrays? (int type)
- Next by thread: Re: Fast access multi-dimensional arrays? (int type)
- Index(es):
Relevant Pages
|