[Proj] Experiment to speed up proj.4 by 2 or more

Even Rouault even.rouault at spatialys.com
Tue Jun 23 11:30:16 EST 2015


José Luis,

> 
> 1. Introducing C++: From my point of view, one of the PROJ best things
> is that it is written in pure C.

In which respect is the actual implementation of proj important to you as a 
user, if you can still use it as a C library ? All nowadays C compilers should 
be able to deal with C++ as well, and here I'm only using C++98 features (I'd 
even say C++83 ;-)), not C++14.

The code compiles with at least back to gcc 4.1 (generated code not optimal 
however), which is really ancient. It doesn't compile with gcc 3.4, but this 
is not because of the C++ part, but lack of support for SSE2 intrinsics.

> Also I can see in the SLEEF folder
> that there exists a folder called 'purec'

Yes, but don't use that one as it is a software emulation of the 
transcendantal functions, that opearte on single double arguments, and that 
has roughly the same performance of standard non-SIMD x87 functions.

The SIMD sleef implementation itself is .c/.h. The C++ bits I added in the 
equation is just to make the code more readable, since using the sleef C 
functions, or directly the Intel intrinsics, would rather be ugly. Do you 
prefer a + b (C++) or vadd_vd_vd_vd(a,b) (SLEEF) or _mm_add_pd(a,b) (Intel 
intrinsics) ? You can just compare the 2 source files of my P.O.C to see the 
benefit of relying on C++ overloaded arithmetic operators (I'm far from being a 
big C++ lover, but that's one of the use cases where it is undoubtly 
appropriate)

> 2. Can be used SLEEF with Intel compilers, PathScale, Portland et al.?

Intel compiler, yes (according to SLEEF doc). No idea for the others (never 
heard about them actually), but I guess that if they're decent enough and have 
support for the SIMD intrinsics, that should work.

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the Proj mailing list