# Investigate slow linking of pybind11 modules

XMLWordPrintable

#### Details

• Type: Story
• Status: Won't Fix
• Resolution: Done
• Fix Version/s: None
• Component/s: None
• Labels:
None
• Story Points:
2
• Epic Link:
• Sprint:
DRP S17-3
• Team:
Data Release Production

#### Description

I'm finding linking pybind11 modules to be extremely slow on my system (Arch Linux; gcc 6.3). A -j4 afw build takes approximately two hours, spending the vast majority of its time linking. This is very much in conflict with Pim Schellart [X]'s much faster timing of afw builds, and I can think of two possible reasons why:

• different compiler/linker/OS (I assume Pim Schellart [X] was using clang on OS X)
• different optimization (I think Pim Schellart [X] was using -O0, while I was using the default of -O3).

If the slow part was compiling, I'd be very worried it was the latter, but I don't think optimization level is likely to affect linking much (though I don't know enough about the details of linkers to be sure). I'm going to run some benchmarks on my machine with clang and with different optimization options, and hopefully on some other linux machines with different versions of gcc. I may try the new gold linker, too.

Pim Schellart [X], could you try builds on your system with -O3?

#### Activity

Hide
Jim Bosch added a comment -

Excellent, will do that now!

Show
Jim Bosch added a comment - Excellent, will do that now!
Hide
Jim Bosch added a comment -

Another round of benchmarks, ruling out gcc as the problem (or at least as an irreducible problem).
Ubuntu 16.04, gcc 6.2:

 real 5m44.108s user 21m32.336s sys 0m52.440s 

Ubuntu 16.04, gcc 6.3:

 real 5m33.542s user 21m3.360s sys 0m46.864s 

Show
Jim Bosch added a comment - Another round of benchmarks, ruling out gcc as the problem (or at least as an irreducible problem). Ubuntu 16.04, gcc 6.2: real 5m44.108s user 21m32.336s sys 0m52.440s Ubuntu 16.04, gcc 6.3: real 5m33.542s user 21m3.360s sys 0m46.864s
Hide
Pim Schellart [X] (Inactive) added a comment -

I think this can go into the cleanup epic?

Show
Pim Schellart [X] (Inactive) added a comment - I think this can go into the cleanup epic?
Hide
Jim Bosch added a comment -

I'm just closing this as Won't Fix, unless someone objects. It looks like the problem is unique to my system, and I have a workaround, so unless someone else runs into this I don't think this is worth our time.

Show
Jim Bosch added a comment - I'm just closing this as Won't Fix, unless someone objects. It looks like the problem is unique to my system, and I have a workaround, so unless someone else runs into this I don't think this is worth our time.
Hide
Jim Bosch added a comment - - edited

In case anyone is curious, I just tried a stack install in Ubuntu 18.04 (gcc 7), and while the stack is enough newer that this is not apples-to-apples, it does not seem to suffer from the slow linking problem: afw Python modules built and linked in 8m31s, which is not bad for a 6-year-old desktop.

Show
Jim Bosch added a comment - - edited In case anyone is curious, I just tried a stack install in Ubuntu 18.04 (gcc 7), and while the stack is enough newer that this is not apples-to-apples, it does not seem to suffer from the slow linking problem: afw Python modules built and linked in 8m31s, which is not bad for a 6-year-old desktop.

#### People

Assignee:
Jim Bosch
Reporter:
Jim Bosch
Watchers:
Jim Bosch, John Parejko, John Swinbank, Kian-Tat Lim, Krzysztof Findeisen, Pim Schellart [X] (Inactive), Serge Monkewitz
Votes:
0 Vote for this issue
Watchers:
7 Start watching this issue

#### Dates

Created:
Updated:
Resolved:

#### Jenkins Builds

No builds found.