mailing list of musl libc
 help / color / mirror / code / Atom feed
* Further dynamic linker optimizations
@ 2015-06-30 20:04 Rich Felker
  2015-07-01  5:41 ` Timo Teras
  2015-07-07 18:39 ` Alexander Monakov
  0 siblings, 2 replies; 12+ messages in thread
From: Rich Felker @ 2015-06-30 20:04 UTC (permalink / raw)
  To: musl

Discussion on #musl with Timo Teräs has produced the following
results:

- Moving bloom filter size to struct dso gives 5% improvement in clang
  (built as 110 .so's) start time, simply because of a reduction of
  number of instructions in the hot path. So I think we should apply
  that patch.

- The whole outer for loop in find_sym is the hot path for
  performance. As such, eliminating the lazy calculation of gnu_hash
  and simply doing it before the loop should be a measurable win, just
  by removing the if (!ghm) branch.

- Even the check if (!dso->global) continue; has nontrivial cost.
  Since I want to replace this representation with a separate
  linked-list chain for global dsos anyway (for other reasons) I think
  that's worth prioritizing for performance too.

- We still don't save and reuse the last symbol lookup in do_relocs.
  Doing so could improve performance a lot when the same symbol is
  referenced multiple times from global data. When the only references
  are the GOT (thus only one per symbol), it's not going to help, but
  since it's outside the find_sym dso loop, it should not have
  measurable cost anyway.

- String comparison (dl_strcmp) is costly, but nontrivial to optimize.
  Word-at-a-time optimizations have issues with crossing pages, even
  on archs that don't require aligned access. Probably the right way
  forward here is to get an optimized general strcmp, then add a
  mechanism (function pointer in struct dso? or global?) for the
  dynamic linker to call dl_strcmp when relocating itself but the real
  strcmp later.

- The strength-reduction of remainder operations does not seem to
  provide worthwhile benefits yet, simply because so little of the
  overall time is spent on the division/remainder.

Rich


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2015-08-06 15:13 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-30 20:04 Further dynamic linker optimizations Rich Felker
2015-07-01  5:41 ` Timo Teras
2015-07-01 14:03   ` Rich Felker
2015-07-01 14:10     ` Timo Teras
2015-07-07 18:39 ` Alexander Monakov
2015-07-07 18:55   ` Rich Felker
2015-07-08  5:48     ` Timo Teras
2015-08-05 22:37       ` Andy Lutomirski
2015-08-06  3:04         ` Rich Felker
2015-08-06  4:32         ` Isaac Dunham
2015-08-06  9:33           ` Szabolcs Nagy
2015-08-06 15:13             ` Andy Lutomirski

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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 NNTP newsgroup(s).