[PATCH] D20732: Don't use static variables in LambdaCapture

John Brawn via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 14 06:15:42 PDT 2016


john.brawn added a comment.

In http://reviews.llvm.org/D20732#456239, @jyknight wrote:

> This looks okay. The only downside: it will increase sizeof(Decl) on 32bit platforms, since the layout is:
>  vtable ptr (4)
>  NextInContextAndBits ptr (4)
>  DeclCtx ptr (4)
>  Loc int (4)
>  bitfield int (4)
>
> Totaling 20 bytes, which will now be rounded up to 24 bytes. I don't know how others feel, but it seems probably fine to me? On 64-bit platforms, it's already 32 bytes, and that won't be affected.


I did an experiment compiling the top 5 largest llvm/clang source files with and without this patch and got the following numbers for "Maximum resident set size (kbytes)" reported by time -v

| **Source File**     | **Before**      | **After**       | **Change**   |
| X86ISelLowering.cpp | 679824 +/- 28   | 679897 +/- 271  | 73 (0.01%)   |
| SemaDecl.cpp        | 705379 +/- 440  | 705590 +/- 77   | 211 (0.03%)  |
| SemaExpr.cpp        | 950729 +/- 6910 | 951654 +/- 5834 | 925 (0.10%)  |
| DAGCombiner.cpp     | 443673 +/- 38   | 443721 +/- 16   | 48 (0.01%)   |
| SemaDeclCXX.cpp     | 850441 +/- 4531 | 851891 +/- 5079 | 1450 (0.17%) |

I think a <0.2% increase in memory usage is fine.


Repository:
  rL LLVM

http://reviews.llvm.org/D20732





More information about the cfe-commits mailing list