[patch] Use a std::vector instead of a std::map to hold Input_merge_map

Rafael Espíndola rafael.espindola@gmail.com
Thu Apr 23 16:36:00 GMT 2015


A std::map is hardly the best data structure for a small map from
small integers.

The attached patch uses a std::vector<std::pair>> instead.

This simplifies the code and speeds up linking of chromium (see
attached perf logs).

Cheers,
Rafael

2015-04-23  Rafael Ávila de Espíndola <rafael.espindola@gmail.com>

* merge.cc (get_input_merge_map): Update for data structure change.
(get_or_make_input_merge_map): Update for data structure change.
* merge.h (Object_merge_map): Use a std::vector<std::pair>> instead of
a std::map.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: master.log
Type: text/x-log
Size: 22754 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20150423/676ed95f/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch2.log
Type: text/x-log
Size: 22769 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20150423/676ed95f/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: t.patch
Type: text/x-patch
Size: 2885 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20150423/676ed95f/attachment-0002.bin>


More information about the Binutils mailing list