How We Achieved 35x Performance for Image Sequences

by | October 18, 2023

At MASV, we deeply value customer feedback and try to act on it as quickly as we can. Sometimes we get positive ideas and feedback on how to make our product better. Other times, feedback is critical — and often more productive.

That’s exactly how we figured out how to improve image sequence performance (AKA large batches of small files).

We are best known for moving the world’s largest files, but our customers also transfer thousands (sometimes millions) of small files at once. If you work with image sequences, giant codebases, or LIDAR scans, you know what we’re talking about.

In this particular use case, our users noticed a slowdown when transferring image sequences. So we got to work on a solution. We are thrilled to announce that MASV is now up to 35x faster for transfers involving huge numbers of small files.

Here’s how we did it.

Table of Contents

What are Image Sequences and How are They Used?

An image sequence is a collection of individual image files, where each image file is a single frame in a video. They’re used in media and film production for things like animation, VFX roundtripping, and color grading.

The advantage of breaking a video into an image sequence is to provide highly detailed information about each video frame. This lets color grading teams do their work precisely and efficiently. It lets special effects teams do more sophisticated scene compositing.

image sequence of a basketball player

It turns out that MASV didn’t have a problem with image sequences specifically.

This was a problem when transferring many, many small files, no matter their format or use.

What Issues Did Our Customers Encounter?

Slow Transfers for Image Sequences

Customers using Desktop app version 2.7.0 and earlier complained about slow transfers for image sequences:

  • A 10-minute 4K video is around 200 GB. With 1Gbps network service, it might have taken 20-30 minutes to download.
  • An equivalent image sequence could be 18,000 image files. Under the same conditions, it might have taken 4.5 hours (or more) to download.

Worse still, customers wasted time in other ways. In one case, a customer tried transferring about 500,000 small files. Our Desktop app couldn’t handle it. In fact, it crashed the component in charge of handling requests for transfers.

The good news is that this crash didn’t affect other transfers or other customers. MASV is built to be resilient so that a single failed transfer doesn’t affect anyone else’s transfers.

Our Support team worked around this problem by manually separating their transfer into smaller transfers, clearing the transfer history, and trying new, custom builds of the Desktop app. Meanwhile, our Engineering team worked on investigating and fixing this problem.

So, what is it about thousands of small files that caused the issue?

Finding the Root(s) of the Problem

We started by benchmarking the MASV Desktop app, versions 2.7.0 and earlier, connected to a 1Gbps network.

We measured the time it took to transfer 10 GB in these ways:

  • One 10 GB file
  • Two-thousand 5 MB files

Here are the most dramatic results:

blog-page-placeholder-image

There are a couple of obvious things:

  • For a single 10 GB file, downloading is almost as fast as uploading. This is standard.
  • For 2000 5 MB files, uploading is 5 times slower and downloading is 35 times slower!

Issue #1: Delaying Read Operations

One of the causes for this slowdown was the way our Desktop app stores downloads on your computer.

To upload a file to the MASV cloud, the Desktop app reads it only once. When downloading from the MASV cloud, the Desktop app writes the file to your storage — but it also needs to read so it can verify the integrity of the transferred file.

Our teams discovered an intentional design decision that was unintentionally slowing transfers for many small files. To reduce the time spent reading while downloading, the MASV Desktop app delayed read operations, giving priority to write operations. Sometimes this delay reached 400ms, almost half a second.

The funny thing is that MASV Desktop app no longer needed this delay. It became obsolete when we changed the way that the Desktop app verified downloaded files. This improvement hid the fact that the delay was barely noticeable for a few large files, a small fraction of the total transfer time. But, as the graph above shows, those delays added up dramatically for many small files..

Issue #2: Slow Transfer History

Our Desktop app has a transfer history, which it uses to keep track of each file that you send and receive. It keeps this information in a database. The database didn’t seem slow at tracking dozens and even hundreds of files. But image sequences can contain hundreds of thousands of files, or more.

We ran a complete audit of this database’s performance. That included simulating a transfer history of 300,000 files, which isn’t uncommon for an image sequence. The database’s slow performance only became obvious when transferring thousands of files.

Issue #3: Slow Request Handling

Our Desktop app also has an internal component that handles file requests between your computer and the MASV cloud servers. Again, this component didn’t seem noticeably slow with a relatively small number of files. But its poor performance was obvious when transferring thousands of files.

How We Addressed the Issues

With a clear idea of what was slowing down MASV, our Engineering team went to work to improve it. You can get these improvements in version 2.7.5 and later:

Improvement #1: Remove the Read Delay

Our Engineering team was happy to remove the obsolete read delay. Software engineers consider it a good day when they can both simplify their code and make it faster.

Improvement #2: Reconfigure File History and Request Handling

Our team tuned the performance of its file history database and added more capacity to the request-handling component. Both can now easily handle hundreds of thousands of files, and more.

From the audit, our Engineers were able to add a few other minor improvements for even more speed and reliability.

Bonus Improvement: Reuse File Handles

It takes a small amount of time to wait for the operating system to open and close a file. That adds up when dealing with thousands of files. The MASV Desktop app now reuses file handles when it can.

The Result: Living Up to Our Promise

Our teams succeeded in fixing the issues that affected image sequences. To say that we’re pleased with the results is an understatement.

Take a look at the results below for MASV Desktop app 2.7.5. You’ll notice that uploads are still fast. Downloads are practically as fast, definitely fast enough to live up to our promise.

blog-page-placeholder-image

Transfer Image Sequences at Incredible Speeds

We take customer requests seriously and act on them as fast as possible. When our customers complained about slow transfers in relation to image sequences, our Engineering and Support teams worked hard to find a solution.

We’re confident that MASV transfers image sequences with practically the same speed as any other files, big or small.

If you work with image sequences, or you’ve tried transferring image sequences with MASV and weren’t satisfied, please download the latest version of Desktop app. We want to keep providing you with the easiest, fastest way to transfer files reliably and securely.

New to MASV?

Try the fastest file transfer for media and heavy graphic assets. Sign-up today.