This answer rather vaguely states "libcofi-rpi.so is a hack to speed up certain memory operations."

Apart from the fact that the file is called libcofi_rpi.so on my machine, what exactly is libcofi ? Where can I find documentation for it ? Is it open source ? What problems does it solve ?


The source isn't exactly top rate (a 2013 thread from the archlinuxarm.org forums), but this seems to tally with your linked answer:

For those who don't know the libcofi was a small library that had hand optimized assembly version of 2 libc functions that could speed applications using those functions a lot, when set to be preloaded.

Libcofi has now been superseded by arm-mem, it provided more hand optimized functions and is also faster. This is included in raspbian by default, so make sure to install this, it would be shame to have slower performance on Arch compared to Debian...

Looks like some enterprising soul optimised the memcpy and memset functions for Raspberry Pi, which ultimately sped up the programs that used them. Bouncing around Google gave me a few hints towards possible source code:

Source: https://www.raspberrypi.org/forums/viewtopic.php?f=71&t=47832

I believe Raspbian uses the libcofi optimized memcpy and memset via the ld.so.preload mechanism (/etc/ld.so.preload), which is from https://github.com/simonjhall/copies-and-fills/

Source: https://github.com/simonjhall/copies-and-fills

Replacement memcpy and memset functionality for the Raspberry Pi with the intention of gaining greater performance.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.