Skip to main content
Question

Reading/Writing/Displaying speed of ZRD files in Zemax NS mode

  • June 16, 2025
  • 1 reply
  • 34 views

Calogero

Hello to all!. 

I usually deal with large ZRD database when doing non-sequential ray traces. Usually this means that displaying detector information or doing ray database filtering takes a considerable amount of time.

 

What is the main bottleneck for the speed of these analysis/processing in Zemax that could be improved by upgrading the PC components?

 

Thank you

1 reply

MichaelH
Ansys Staff
Forum|alt.badge.img+2
  • Ansys Staff
  • 368 replies
  • June 18, 2025

Hi Tomas,

I’ll just give my opinion (someone with more hardware knowledge could still respond).  A ZRD file is a binary file that has to be read sequentially, segment by segment.  This is because to efficiently pack the ZRD file, after the header section of the ZRD file with version number and maximum allowed segments, each individual segment is defined by a 4-byte integer storing the number of segments for the current ray and then a 232-byte struct.  You don’t know where the next ray starts in the binary file until all the segments are read from the previous ray.

With that said, the 3 main impacts for ZRD speed will be:

  • CPU clock speed (faster speed is quicker read/write of ZRD)
  • Amount of RAM (should make sure RAM is 2x-4x larger than maximum ZRD file size, otherwise memory paging and writing to disk will happen a lot)

The things that would not affect the speed of reading ZRD file:

  • *Number of CPUs
  • GPU

*The Number of CPUs will affect the NSC Ray Trace, so it will drastically speed up the creation of a ZRD file since OpticStudio can chunk the number of rays each CPU/thread will trace.  But once the ZRD is created, it has to be read sequentially on a single thread.

There are additional recommendations in the following articles:

https://support.zemax.com/hc/en-us/articles/1500005575042-What-computer-should-I-buy-to-run-OpticStudio 

https://community.zemax.com/got-a-question-7/new-computer-performance-advice-3550 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings