After few search, there are performance differences between the used libc. In our case, it seems the problems are not LXC related so this thread can be closed.
speed comparison
a test with rust in docker
This blog post is interesting but the wheel comparison is not relevant to the previous tests I done because compiling cpython does not use wheel packages.