[PATCH] D103072: [llvm-readobj] Optimize printing stack sizes to linear time.
Rahman Lavaee via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon May 24 21:55:04 PDT 2021
rahmanl created this revision.
rahmanl added a reviewer: grimar.
Herald added a subscriber: rupprecht.
Herald added a reviewer: jhenderson.
rahmanl retitled this revision from "[llvm-readobj] Optimize function name lookup with `--stack-sizes` from quadratic to linear." to "[llvm-readobj] Make printing stack sizes linear instead of quadratic.".
rahmanl edited the summary of this revision.
rahmanl retitled this revision from "[llvm-readobj] Make printing stack sizes linear instead of quadratic." to "[llvm-readobj] Optimize printing stack sizes to linear time.".
rahmanl published this revision for review.
Herald added subscribers: llvm-commits, MaskRay.
Herald added a project: LLVM.
Currently, each function name lookup is a linear iteration over all symbols defined in the object file which makes the total running time quadratic.
This patch optimizes the function name lookup by populating an **address to index** map upon the first function name lookup which is used to lookup each function name in O(1).
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D103072
Files:
llvm/tools/llvm-readobj/ELFDumper.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D103072.347576.patch
Type: text/x-patch
Size: 6922 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210525/25ee1e38/attachment.bin>
More information about the llvm-commits
mailing list