[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Performance optimization (allocation inside a for loop)
From: |
Andreas Romeyke |
Subject: |
Re: Performance optimization (allocation inside a for loop) |
Date: |
Thu, 2 Apr 2009 08:11:25 +0200 |
Hello,
Am Thu, 2 Apr 2009 00:18:28 +0100
schrieb r <address@hidden>:
> A common strategy is to allocate a bit more space than currently
> needed, so that malloc/realloc doesn't need to be called every single
> time the user appends data to the structure. Even better, this margin
> can be made dependent on the current structure size (e.g. proportional
> to n or to log(n)). This second scheme results in better
> performance/memory occupation ratio.
You are right, BUT octave handles with really big amounts of data. A
pre-allocation of data is not helpful in this cases.
> I'm (now) perfectly OK with preallocating memory manually, but it took
> me a lot of time to figure out where the bottleneck is. BTW, low "for"
> loop performance is commonly blamed on the lack of a JIT compiler, but
> I wouldn't be surprised if at least some of the test cases were
> actually suffering from issues like memory allocation. After all, JIT
> compilers don't typically speed up evaluation by more than a constant
The better way is to improve the tools to support the developers and
users to find bottlenecks, to suggest good practises and to develop an
JIT-compiler.
my 2 cents...
Bye Andreas
--
Software Developer / Dipl. Inform. (FH)
Max Planck Institute for Human Cognitive and Brain Sciences
Department of Psychology
Stephanstr. 1a, 04103 Leipzig, Germany
signature.asc
Description: PGP signature
- Re: Performance optimization (allocation inside a for loop), (continued)
- Re: Performance optimization (allocation inside a for loop), James Sherman Jr., 2009/04/02
- Re: Performance optimization (allocation inside a for loop), John W. Eaton, 2009/04/02
- Re: Performance optimization (allocation inside a for loop), Elias Assmann, 2009/04/02
- Re: Performance optimization (allocation inside a for loop), Rob Mahurin, 2009/04/02
- Re: Performance optimization (allocation inside a for loop), John W. Eaton, 2009/04/02
- Re: Performance optimization (allocation inside a for loop), Rob Mahurin, 2009/04/02
- Re: Performance optimization (allocation inside a for loop), Jaroslav Hajek, 2009/04/02
- Re: Performance optimization (allocation inside a for loop), Jaroslav Hajek, 2009/04/02
- Re: Performance optimization (allocation inside a for loop), Francesco Potorti`, 2009/04/02
- Re: Performance optimization (allocation inside a for loop), Jaroslav Hajek, 2009/04/02
- Re: Performance optimization (allocation inside a for loop),
Andreas Romeyke <=
Re: Performance optimization (allocation inside a for loop), Przemek Klosowski, 2009/04/03
Re: Performance optimization (allocation inside a for loop), Francesco Potorti`, 2009/04/02
- Re: Performance optimization (allocation inside a for loop), r, 2009/04/02
- Re: Performance optimization (allocation inside a for loop), John W. Eaton, 2009/04/02
- Re: Performance optimization (allocation inside a for loop), r, 2009/04/02
- Re: Performance optimization (allocation inside a for loop), Jaroslav Hajek, 2009/04/04
- Re: Performance optimization (allocation inside a for loop), r, 2009/04/04
- Re: Performance optimization (allocation inside a for loop), Jaroslav Hajek, 2009/04/04
- Re: Performance optimization (allocation inside a for loop), Jaroslav Hajek, 2009/04/04