[PATCH] D20272: [ELF] - Support of compressed input sections implemented.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Mon May 16 06:48:02 PDT 2016


grimar added a comment.

In http://reviews.llvm.org/D20272#430485, @ruiu wrote:

> This patch uncompresses all input sections whether they are going to be added to the output or not. A lot of sections are in fact not going to make it to the output because of comdat deduplication and section gc. So uncompressing all inputs beforehand would be a waste of resource.
>
> Until the content is copied to the output, I think we don't have to uncompress inputs. Do you think you can do it lazily?


Thank you for this and other comments about the patch. I want to assure you that this time I was aware about most of details you wrote :)

There were 2 reasons from my side why I implemented it in this way:

1. MergeOutputSection requires early access to uncompressed data. It uses it in constructor, it uses it in InputSectionBase<ELFT>::getOffset() and in other places. I am currently investigating how it is possible to improve that. I am pretty sure we do not want to have different logic for compressed/uncompressed sections, so I hope to refactor how MergeOutputSection works at first then. I mean that we probably want to delay the access to data as much as we can here. That was technical problem I faced, but I was sure it is not a problem for implementation way I used because of next:

2. I was thinking that since compressed sections are used for compressing debug stuff, then nobody really cares about perfomance. That is something I am missing probably, but if we are talking about linkage speed during development process, then I assume that compression probably not involved. Compression-decompression takes time, and hdd space it too much cheap to use that. But when we switch to generating "production" binary using some inputs with debugging sources, then I assumed there is not much sence to save few percents (probably) of final time if we can keep code simple instead. Please point me what I missing here.

Anyways, I am currently investigating the MergeOutputSection logic, I hope to be able to refactor it a bit. I am hard in commenting here, I still need to investigate that.


http://reviews.llvm.org/D20272





More information about the llvm-commits mailing list