FFI Performance - Graham Ollis

Опубликовано: 11 Июль 2026
на канале: Pittsburgh Perl Workshop
286
3

Foreign Function Interface (FFI) is a popular method of implementing extensions that rely on C libraries in languages such as Ruby, Python, Java, and of course Perl. FFI has not hit the big time in Perl, but has a number of advantages over Perl's historical extension language known as XS. One concern about migration parts of CPAN from XS to FFI is the perception that XS is faster. I will address real life FFI performance by discussing several factors. I will start with techniques that can be used in the FFI layer to improve performance for all FFI modules. Secondly we will tackle approaches at the Perl level that can improve overall performance. Finally, we will consider when developer productivity versus CPU productivity.