Ten thousand maggots were seen feasting on a 16-inch pizza, demolishing the entire pie in just two hours — an impressive accomplishment for the black soldier fly larvae. The feeding frenzy inspired researchers to study how larvae teamed up to maximize their consumption.

A group of researchers from the Georgia Institute of Technology looked at way maggots eat by having them nibble on a variety of orange slices and watching them feast on medium pizza — from swarms of 500 to 10,000. Their findings were published in the Journal of the Royal Society Interface on Wednesday.

Black soldier fly larvae were of particular interest to the researchers who noted they are frequently used to help break down food waste.

WORLD'S OLDEST SPIDER DIES AFTER WASP ATTACK

"When found on carcasses or piles of rotting fruit, this larva often outcompetes other species of scavengers for food," researchers Olga Shishkov, Michael Hu, Christopher Johnson and David Hu wrote in a synopsis of the study, adding they wanted to find out how the larvae can "eat so quickly."

To better understand this, the researchers placed the food in front of the maggots and filmed their response. After watching the footage, they were able to conclude the larvae form a "fountain" around the food. They used a method called particle image velocimetry (PIC) to visualize the flow and motion of the hungry maggots.

On their own, a larva can only eat in 5-minute "bursts," the researchers observed, saying this forms "roadblocks" around the food.

"To overcome these limitations, larvae push each other away from the food source, resulting in the formation of a fountain of larvae. Larvae crawl towards the food from below, feed and then are expelled on the top layer. This self-propagating flow pushes away potential roadblocks, thereby increasing eating rate," the authors explained in their published article.

It's common for swarms of larvae to eat together, given hundreds can hatch at once.

Shishkov, one of the study's lead authors, told LiveScience that each larva can eat up to twice its body mass in just 24 hours.

BEDBUGS TAKE OVER TEXAS HOTEL BEDROOM IN SKIN-CRAWLING PHOTOS: 'THERE WAS BLOOD ON THE SHEETS'

"If you watch a video of any kind of maggots, they squirm around a lot. They're constantly in motion," Shishkov told the news outlet. "If this didn't benefit them, they probably wouldn't be wasting their energy."

So, how can this benefit humans?

"At the end of their lives, the larvae are used as a sustainable feed source for chickens, fish and other livestock animals. When farming larvae, maximizing eating rate is desired so that the larvae can grow as quickly as possible," the researchers explained.