Free Republic
Browse · Search
General/Chat
Topics · Post Article

Skip to comments.

'The biggest speedup I've seen so far' — FFmpeg devs boast of another 100x leap thanks to handwritten assembly code
Tom's Hardware ^ | 17 July 2025 | Mark Tyson

Posted on 07/17/2025 11:00:22 AM PDT by ShadowAce

The developers behind the FFmpeg project are again claiming major performance uplifts delivered by wielding the art of handwritten assembly code. With the latest patch applied, users should see a “100x speedup” in the cross-platform open-source media transcoding application. However, the developers were soon to clarify that the 100x claim applies to just a single function, “not the whole of FFmpeg.”

BREAKING: FFmpeg 100x speedup from handwritten assembly13:55:30 <•haasn> rangedetect8_avx512: 121.2 (100.18x) that may be the biggest speedup I've seen so farJuly 16, 2025

“The biggest speedup I've seen so far”

Last November, we reported on an FFmpeg performance boost that could speed certain operations by up to 94x. The latest handwritten assembly patch boosts the app’s ‘rangedetect8_avx512’ performance by 100.73%. If your modern processor doesn’t support AVX512, you should still see a 65.63% uplift with the rangedetect8_avx2 code path.

Where will you feel these speed increases? In some follow-up tweets, the FFmpeg developers admit that “It's a single function that's now 100x faster, not the whole of FFmpeg.” They would later go on to elaborate that the functionality, which might enjoy a 100% speed boost, depending upon your system, was “an obscure filter.”

The obscurity of the function means it hadn’t been prioritized by the devs until now. But we also gather that the filter code was recoded using the SIMD (Single Instruction, Multiple Data) processing concept for vastly improved parallel processing on today’s powerful chips.

Evidently, compilers – programs that take higher-level language code and spit out assembly (machine) code – are still not competitive with handwritten assembly. Or you could say, “register allocator sucks on compilers,” as FFmpeg tweeted today.

Assembly language evangelicals

Harking back to the golden age of home computing in the 1980s and 1990s, where fixed-spec systems had lifecycles measured in half-decades - and strictly limited processing resources - handwritten assembly code optimizations played a larger part in the business of speeding up computers, games, and other software.

FFmpeg is perhaps one of the few ‘assembly evangelists’ remaining. The dev team even runs a ‘school.’

FFmpeg tools and libraries run across Linux, Mac OS X, Microsoft Windows, the BSDs, Solaris, systems, and more. One of the most popular video player software utilities, VLC, uses the libavcodec and libavformat libraries from the FFmpeg project.



TOPICS: Computers/Internet
KEYWORDS: assembly; code; compiler; efficiency
Navigation: use the links below to view more comments.
first 1-2021-27 next last

1 posted on 07/17/2025 11:00:22 AM PDT by ShadowAce
[ Post Reply | Private Reply | View Replies]

To: rdb3; JosephW; martin_fierro; Still Thinking; zeugma; Vinnie; ironman; Egon; raybbr; AFreeBird; ...

2 posted on 07/17/2025 11:00:34 AM PDT by ShadowAce (Linux - The Ultimate Windows Service Pack )
[ Post Reply | Private Reply | To 1 | View Replies]

To: ShadowAce

I’ve been saying for years that the reason software eats up so much hardware (and it’s advances) is the compiler.


3 posted on 07/17/2025 11:01:09 AM PDT by ShadowAce (Linux - The Ultimate Windows Service Pack )
[ Post Reply | Private Reply | To 1 | View Replies]

To: ShadowAce

I did a bit of Assembly language programming, but it was not something I would have encouraged, then.

Today’s processors can do so much more on chip that it’s amazing. Assembly could likely help that, a lot.


4 posted on 07/17/2025 11:03:54 AM PDT by ConservativeMind (Trump: Befuddling Democrats, Republicans, and the Media for the benefit of the US and all mankind.)
[ Post Reply | Private Reply | To 1 | View Replies]

To: ShadowAce
If all these AI wizards wanted a great place to focus efforts on things that mattered, making an AI-guided compiler would be actually appreciated.

(Instead of things designed to rip off and lay off humans.)

5 posted on 07/17/2025 11:05:51 AM PDT by Yossarian
[ Post Reply | Private Reply | To 1 | View Replies]

To: ShadowAce

I became a COBOL programmer back in 1983. One of the arguments an old Assembler guy and I used to have was regarding “efficient” vs “easily maintainable” code. Even back in the 80’s computers had become so fast that we were more concerned about the cost of maintenance rather than the cost of processing.

I rewrote a batch “local long distance toll rating” program and reduced it from 10,500 lines to 5,600 lines. It even had “alter go tos” in it. In the process of rewriting it, I found four problems that, when the SME was notified, turned out were problems they were aware of, but had no idea which program was causing them.

Some sections were accessed through “go to” and were accessed from other sections via “perform”, and sometimes “perform through”. It was a mess.

I had been trained by Boeing in “Pretty code”. It mattered. This was in 1993. I’m shocked I still remember this while I can’t remember where I laid down my phone.


6 posted on 07/17/2025 11:06:48 AM PDT by cuban leaf (2024 is going to be one for the history books, like 1939. And 2025 will be more so, like 1940-1945.)
[ Post Reply | Private Reply | To 3 | View Replies]

To: ShadowAce
One wonders if one could use AI to teach your penguins to emulate the Rockettes.

Inquiring mind wants to know. ;-)

On and Offenbach, and all that.

7 posted on 07/17/2025 11:09:57 AM PDT by Carry_Okie (The tree of liberty needs a rope.)
[ Post Reply | Private Reply | To 2 | View Replies]

To: cuban leaf
Yeah--I spent the first half of my career in COBOL. Pretty code is Goodtm.

But improvements to compilers should be the priority. It does not seem to be that way these days.

8 posted on 07/17/2025 11:18:23 AM PDT by ShadowAce (Linux - The Ultimate Windows Service Pack )
[ Post Reply | Private Reply | To 6 | View Replies]

To: sauropod

.


9 posted on 07/17/2025 11:27:17 AM PDT by sauropod (Make sure Satan has to climb over a lot of Scripture to get to you. John MacArthur Ne supra crepidam)
[ Post Reply | Private Reply | To 1 | View Replies]

To: ShadowAce

Hand written? So some people can still read cursive?


10 posted on 07/17/2025 11:30:41 AM PDT by SkyDancer ( ~ Am Yisrael Chai ~)
[ Post Reply | Private Reply | To 1 | View Replies]

To: ShadowAce

The first program I bought was a machine language monitor and it was 110 bytes of code. Ran on a computer with 4k of memory. That code was tight and elegant and puts todays bloated software to shame.


11 posted on 07/17/2025 11:56:02 AM PDT by GMMC0987
[ Post Reply | Private Reply | To 1 | View Replies]

To: SkyDancer
I can :)

But then again--I'm ancient.

12 posted on 07/17/2025 11:56:23 AM PDT by ShadowAce (Linux - The Ultimate Windows Service Pack )
[ Post Reply | Private Reply | To 10 | View Replies]

To: ShadowAce

Well I learned cursive when home schooled.


13 posted on 07/17/2025 12:05:14 PM PDT by SkyDancer ( ~ Am Yisrael Chai ~)
[ Post Reply | Private Reply | To 12 | View Replies]

To: ShadowAce

COBOL and Assembler.......I learned IBM 360 versions of both in college in the ‘70’s, and served an internship at Columbia River Log Scaling Bureau in Eugene, Or. The main thing I learned from the internship was that programming was just a hobby for me, not a career.


14 posted on 07/17/2025 12:08:36 PM PDT by jimtorr
[ Post Reply | Private Reply | To 1 | View Replies]

To: ConservativeMind

I only use Windowz PC, but the computer bargain on the year is the M4 mac-mini at $549. That has 256GB NVMe and 16GB RAM. During Prime Days last week it was only $500. If I bought one, the only thing I would add would be 1TB external NVMe for storage. Price about 70-80$

DisplayPort is the way to go and this mac-mini can run three displays simultaneously VIA>>>

Thunderbolt 4 (USB-C) ports (located on the back)
One HDMI 2.1 port


15 posted on 07/17/2025 12:24:19 PM PDT by dennisw (There is no limit to human stupidity)
[ Post Reply | Private Reply | To 4 | View Replies]

To: ConservativeMind

Yeah l dabbled in assy too. When every byte of memory was precious it was a go to tool.


16 posted on 07/17/2025 12:32:16 PM PDT by iamgalt
[ Post Reply | Private Reply | To 4 | View Replies]

To: cuban leaf

Interesting- a program I was working at BA used Python and Jinja to create templates for C++ modules.


17 posted on 07/17/2025 12:34:44 PM PDT by RitchieAprile (available monkeys looking for the change..)
[ Post Reply | Private Reply | To 6 | View Replies]

To: cuban leaf

We did a lot macro’s for BASM. It helped a little bit, also subroutines were helpful but not near as neat as functions in ‘C’. Having to save and restore registers was always the biggest issue.


18 posted on 07/17/2025 12:45:38 PM PDT by ImJustAnotherOkie
[ Post Reply | Private Reply | To 6 | View Replies]

To: ConservativeMind

Yeah l dabbled in assy too. When every byte of memory was precious it was a go to tool.


19 posted on 07/17/2025 1:34:22 PM PDT by iamgalt
[ Post Reply | Private Reply | To 4 | View Replies]

To: cuban leaf
I found four problems that, when the SME was notified, turned out were problems they were aware of, but had no idea which program was causing them.

In my experience. going back into old code to "make it pretty" is often how that kind of problem is found and corrected.

Some sections were accessed through “go to” and were accessed from other sections via “perform”, and sometimes “perform through”. It was a mess.

Sounds like a true coding abomination. Congratulations on sorting out such a thing. A lesser talent might have run screaming for the door with their hair on fire.

How long did it take before the nightmares stopped?

20 posted on 07/17/2025 2:05:47 PM PDT by flamberge (The times, they are a' changing.)
[ Post Reply | Private Reply | To 6 | View Replies]


Navigation: use the links below to view more comments.
first 1-2021-27 next last

Disclaimer: Opinions posted on Free Republic are those of the individual posters and do not necessarily represent the opinion of Free Republic or its management. All materials posted herein are protected by copyright law and the exemption for fair use of copyrighted works.

Free Republic
Browse · Search
General/Chat
Topics · Post Article

FreeRepublic, LLC, PO BOX 9771, FRESNO, CA 93794
FreeRepublic.com is powered by software copyright 2000-2008 John Robinson