[PATCH] BumpPtr allocate SimpleReferences

Rui Ueyama ruiu at google.com
Thu Dec 4 13:20:12 PST 2014


I think Colin's calculation is correct. That makes me think of whether or
not we really want to use BumpPtr allocator at all. We might be trying to
optimize too much without knowing if this is important for performance (I
could be easily convinced if there's benchmark result). Regular memory
allocator shouldn't be that slow, and instead of doing something clever
with BumpPtr, we can always use operator new and smart pointers.

On Thu, Dec 4, 2014 at 12:07 PM, colinl at codeaurora.org <
colinl at codeaurora.org> wrote:

> It doesn't seem like there's any memory different between the linked list
> version and the bumpvector version.  The linked list version requires
> 2*(pointer_size)*N memory and if a bumpvector is resized to double each
> time, the sum of all intermediate backing allocations comes out the same.
>
> 16 Items in a linked list requires 2*16*pointer
> 16 Items in a bumpvector requires (1+2+4+8+16)*pointer
>
> http://reviews.llvm.org/D6518
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141204/72412235/attachment.html>


More information about the llvm-commits mailing list