comp.lang.ada
 help / color / mirror / Atom feed
From: "J-P. Rosen" <rosen@adalog.fr>
Subject: Re: GNAT vs Matlab - operation on multidimensional complex matrices
Date: Tue, 24 Mar 2020 07:40:28 +0100
Date: 2020-03-24T07:40:28+01:00	[thread overview]
Message-ID: <r5ca0r$tjv$1@dont-email.me> (raw)
In-Reply-To: <6c2c0e35-af07-4169-8be5-464ec7fd0fd5@googlegroups.com>

Le 24/03/2020 à 00:16, darek a écrit :
> Hi Everyone, 
>  I am working on radar signal processing algorithms that use multidimensional complex arrays. 
> 
> To my surprise, the performance of some Matlab functions is much better than compiled Ada code. 
> 
[...]

Two remarks:
1) why do you need pointers? Ada is very good at using pointer only when
absolutely necessary, which is good for safety and efficiency.

2) you are comparing a hand-written, naive[1] algorithm with a
specialized function that may well be written in assembly language,
making use of special SIMD instructions. I would say that Ada does not
behave that bad...

[1] Naive in that you simply use the "obvious" loops. If you want
maximum efficiency, a lot of tricky factors come into play. For example,
changing the order of the nesting of the loops changes the spread of
memory accesses, which can (or not) have a dramatic effect on
efficiency, given the various caches, whether successive memory accesses
belong to the same memory bank, etc. High efficiency mathematical
libraries are designed to consider these effects.

-- 
J-P. Rosen
Adalog
2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX
Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00
http://www.adalog.fr

  parent reply	other threads:[~2020-03-24  6:40 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-23 23:16 GNAT vs Matlab - operation on multidimensional complex matrices darek
2020-03-24  2:07 ` johnscpg
2020-03-24  6:40 ` J-P. Rosen [this message]
2020-03-24  9:37 ` Jeffrey R. Carter
2020-03-24 14:55   ` darek
2020-03-24 15:44 ` johnscpg
2020-03-31 17:25 ` Shark8
2020-03-31 19:20   ` Simon Wright
2020-03-31 19:54     ` Shark8
2020-04-29 21:08     ` vincent.diemunsch
2020-04-01 11:01   ` darek
2020-04-01 15:01     ` J-P. Rosen
2020-04-01 16:39       ` darek
2020-04-01 17:15         ` J-P. Rosen
2020-03-31 20:05 ` Shark8
2020-03-31 20:51   ` Jeffrey R. Carter
2020-06-08 17:42 ` Shark8
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox