X

NV5 Geospatial Blog

Each month, NV5 Geospatial posts new blog content across a variety of categories. Browse our latest posts below to learn about important geospatial information or use the search bar to find a specific topic or author. Stay informed of the latest blog posts, events, and technologies by joining our email list!



Mapping Earthquake Deformation in Taiwan With ENVI

Mapping Earthquake Deformation in Taiwan With ENVI

12/15/2025

Unlocking Critical Insights With ENVI® Tools Taiwan sits at the junction of major tectonic plates and regularly experiences powerful earthquakes. Understanding how the ground moves during these events is essential for disaster preparedness, public safety, and building community resilience. But traditional approaches like field... Read More >

Comparing Amplitude and Coherence Time Series With ICEYE US GTR Data and ENVI SARscape

Comparing Amplitude and Coherence Time Series With ICEYE US GTR Data and ENVI SARscape

12/3/2025

Large commercial SAR satellite constellations have opened a new era for persistent Earth monitoring, giving analysts the ability to move beyond simple two-image comparisons into robust time series analysis. By acquiring SAR data with near-identical geometry every 24 hours, Ground Track Repeat (GTR) missions minimize geometric decorrelation,... Read More >

Empowering D&I Analysts to Maximize the Value of SAR

Empowering D&I Analysts to Maximize the Value of SAR

12/1/2025

Defense and intelligence (D&I) analysts rely on high-resolution imagery with frequent revisit times to effectively monitor operational areas. While optical imagery is valuable, it faces limitations from cloud cover, smoke, and in some cases, infrequent revisit times. These challenges can hinder timely and accurate data collection and... Read More >

Easily Share Workflows With the Analytics Repository

Easily Share Workflows With the Analytics Repository

10/27/2025

With the recent release of ENVI® 6.2 and the Analytics Repository, it’s now easier than ever to create and share image processing workflows across your organization. With that in mind, we wrote this blog to: Introduce the Analytics Repository Describe how you can use ENVI’s interactive workflows to... Read More >

Deploy, Share, Repeat: AI Meets the Analytics Repository

Deploy, Share, Repeat: AI Meets the Analytics Repository

10/13/2025

The upcoming release of ENVI® Deep Learning 4.0 makes it easier than ever to import, deploy, and share AI models, including industry-standard ONNX models, using the integrated Analytics Repository. Whether you're building deep learning models in PyTorch, TensorFlow, or using ENVI’s native model creation tools, ENVI... Read More >

1345678910Last
20367 Rate this article:
4.3

The speed of IDL compared with other languages

Anonym

Because IDL is array based, it can give very good execution speed compared with other programming languages. The main reason is that array based computations tend to optimize memory access patterns since array elements are stored adjacent in memory and accessed in sequence. Because actual computation speed has gotten much faster over time, it is often not the bottleneck for achieving good speed on a computational algorithm. Instead, memory access, memory caching, and cache misses are what dominates the speed by slowing down the performance.

I wanted to do a simple, unscientific speed comparison using an algorithm that I have already implemented earlier. I chose the LSD radix sort algorithm since the Wikipedia article includes example code for several programming languages: C, C++, C++14, Python, Java. See this link.  Also see this IDL blog for reference.

I modified the code for all the languages to use a 10,000,000 element 32-bit integer array containing random integers between 0 - 9,999,999. The main modifications were to use a radix (base) of 256, and use a dynamically allocated array that could handle 10,000,000 elements. For the examples that used radix 10 (Java), I also needed to expand the buckets to 256 to hold the histogram for each iteration.

I ran all the tests on the same 6-core Intel(R) Xeon(R) system.Here are the results:

Python:  16.3 seconds(after optimizing a bit, original was 29.3 seconds)

C++: 14.0 seconds

Java: 9.2 seconds

C++14: 2.2 seconds

IDL: 0.86 seconds

C:  0.72 seconds

In my test IDL ends up in a close second place behind the C implementation. Obviously, these code examples are not fully optimized for speed, but might be representative of how people write code when there is not enough time to spend on optimizing the code. I would also mention that the readability of the IDL code is a significant advantage.  The IDL code is done in 20 lines, whereas the C code uses 76 lines. This makes it easy to add changes and improvements to the IDL code.

This is an example where IDL performs very well. There are obviously other cases where IDL code can run much slower than optimal.  I have found that in most cases when my IDL code runs slow, it is caused by using too many loops and scalar operations instead of more array based operations.

Here is the code listing for the IDL version of the10,000,000 element integer sort, (it also runs 3.8 times faster than IDL's built in sort, for this particular case):

pro idlRadix

 compile_opt idl2,logical_predicate

 

 n = 10000000

 data = randomu(seed, n, /long) mod n

 sorted = data

 

 tic

 radix = 256LL

 factor = 1ull

 for i=0,3 do begin

   rem = sorted/factor

   digit = rem mod radix

   factor = factor*radix

   h = histogram(digit, min=0, max=radix-1, binsize=1, $

     reverse_indices=ri)

   sorted = sorted[ri[radix+1:*]]

 endfor

 toc

 

 tic

 tmp = data[sort(data)]

 toc

 

 if array_equal(tmp, sorted) then print, 'Sorted correctly'

end

Please login or register to post comments.