public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "carlos at redhat dot com" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sourceware.org
Subject: [Bug libc/26179] _dl_map_object_deps re-walking transitive deps of already loaded DSOs
Date: Fri, 03 Jul 2020 16:18:27 +0000	[thread overview]
Message-ID: <bug-26179-131-7GsTghZIeJ@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-26179-131@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=26179

Carlos O'Donell <carlos at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |carlos at redhat dot com
         Resolution|---                         |DUPLICATE
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #1 from Carlos O'Donell <carlos at redhat dot com> ---
(In reply to Andrew from comment #0)
> Created attachment 12665 [details]
> fix_dl_map_object_deps
> 
> In workflows with lots of DSOs which are independently `dlopen`d but which
> have several common dependency DSOs, each `_dl_map_object_deps` call will
> re-walk these common transitive deps, doing O(N) `strcmp`s in
> `_dl_map_object` for each one, which can become costly.
> 
> I noticed this while looking into some workflows where Python code `dlopen`s
> a lot of DSOs, each of which shares a lot of transitive deps with the
> others.  Profiling shows a significant time is spent in `strcmp`. 
> 
> It looks like much of this work can be avoided having each call to
> `_dl_map_object` also return whether that DSO was already loaded, and
> terminate the recursion if so.  An example of an attempt at this is attached
> which removed most of this overhead (but I'm not entirely sure it's safe).

We are already working on resolving this as part of bug 17645.

We are only v2.1 of the fix that switches to a full DFS RPO sort with "use"
tracking per link map to avoid visiting nodes again, and terminating the sort
early if the list was already sorted.

I'm marking this as a duplicate of bug 17645.

*** This bug has been marked as a duplicate of bug 17645 ***

-- 
You are receiving this mail because:
You are on the CC list for the bug.

      parent reply	other threads:[~2020-07-03 16:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-28  0:27 [Bug libc/26179] New: " andrewjcg at gmail dot com
2020-06-28  0:28 ` [Bug libc/26179] " andrewjcg at gmail dot com
2020-07-03 16:06 ` P at draigBrady dot com
2020-07-03 16:18 ` carlos at redhat dot com [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-26179-131-7GsTghZIeJ@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).