ChenMiaoi wrote:

> > Could you clarify the expected benefit of this change? In particular, I'm 
> > not sure that adding a constructor solely to enable emplace_back is 
> > worthwhile here. Do you have any measurements showing a performance 
> > improvement?
> 
> Motivated solely from the FIXME in the code and yes the performance should 
> not really be much as the seen from usual benchmarks of `emplace_back()` vs 
> `push_back()` but I believe it would be better to use `emplace_back` where it 
> makes sense for its benefits
> 
> I can try to get some performance benchmarks for this change in a while as 
> I'm currently not sure how to benchmark this

I missed the FIXME earlier. With C++20, we could switch directly to 
emplace_back without adding a constructor. However, LLVM currently requires 
C++17, so I think it would be better to wait until C++20 becomes the minimum 
requirement. Otherwise, we would be adding a constructor solely to enable 
emplace_back, only to remove it once we adopt C++20.

https://github.com/llvm/llvm-project/pull/232260
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to