Re: [PATCH] improve performance of std::allocator::deallocate

2019-05-20 Thread Jonathan Wakely
On 20/05/19 19:21 +0200, François Dumont wrote: On 5/20/19 1:14 PM, Jonathan Wakely wrote: - r1->deallocate(p, 2); + r1->deallocate(p, 2, alignof(char)); + __builtin_printf("%d\n", (int)bytes_allocated); Was this last line really intended to be added ? No, and I've already removed it

Re: [PATCH] improve performance of std::allocator::deallocate

2019-05-20 Thread François Dumont
On 5/20/19 1:14 PM, Jonathan Wakely wrote: - r1->deallocate(p, 2); + r1->deallocate(p, 2, alignof(char)); + __builtin_printf("%d\n", (int)bytes_allocated); Was this last line really intended to be added ?

Re: [PATCH] improve performance of std::allocator::deallocate

2019-05-20 Thread Jonathan Wakely
On 20/05/19 10:44 +0100, Jonathan Wakely wrote: On 20/05/19 09:17 +, Pádraig Brady wrote: On 04/02/2019 07:33 PM, Padraig Brady wrote: On 03/07/2019 03:43 AM, Jonathan Wakely wrote: OK, that makes me feel better about it. It's presumably much easier to upgrade to 5.2 from 5.0 or 5.1

Re: [PATCH] improve performance of std::allocator::deallocate

2019-05-20 Thread Jonathan Wakely
On 20/05/19 09:17 +, Pádraig Brady wrote: On 04/02/2019 07:33 PM, Padraig Brady wrote: On 03/07/2019 03:43 AM, Jonathan Wakely wrote: OK, that makes me feel better about it. It's presumably much easier to upgrade to 5.2 from 5.0 or 5.1 than it would be from 4.x. How complicated is the

Re: [PATCH] improve performance of std::allocator::deallocate

2019-05-20 Thread Pádraig Brady
On 04/02/2019 07:33 PM, Padraig Brady wrote: > On 03/07/2019 03:43 AM, Jonathan Wakely wrote: >> OK, that makes me feel better about it. It's presumably much easier to >> upgrade to 5.2 from 5.0 or 5.1 than it would be from 4.x. >> How complicated is the fix to prevent the crashes? Would

Re: [PATCH] improve performance of std::allocator::deallocate

2019-04-02 Thread Pádraig Brady
On 03/07/2019 03:43 AM, Jonathan Wakely wrote: > On 06/03/19 22:27 +, Pádraig Brady wrote: >> >> >> On 03/06/2019 01:44 AM, Jonathan Wakely wrote: >>> On 06/03/19 09:20 +, Pádraig Brady wrote: On 03/06/2019 12:50 AM, Jonathan Wakely wrote: > On 06/03/19 02:43 +, Pádraig

Re: [PATCH] improve performance of std::allocator::deallocate

2019-03-07 Thread Jonathan Wakely
On 06/03/19 22:27 +, Pádraig Brady wrote: On 03/06/2019 01:44 AM, Jonathan Wakely wrote: On 06/03/19 09:20 +, Pádraig Brady wrote: On 03/06/2019 12:50 AM, Jonathan Wakely wrote: On 06/03/19 02:43 +, Pádraig Brady wrote: On 02/26/2019 04:23 PM, Padraig Brady wrote: Note

Re: [PATCH] improve performance of std::allocator::deallocate

2019-03-06 Thread Pádraig Brady
On 03/06/2019 01:44 AM, Jonathan Wakely wrote: > On 06/03/19 09:20 +, Pádraig Brady wrote: >> On 03/06/2019 12:50 AM, Jonathan Wakely wrote: >>> On 06/03/19 02:43 +, Pádraig Brady wrote: On 02/26/2019 04:23 PM, Padraig Brady wrote: > >> Note jemalloc >= 5.1 is

Re: [PATCH] improve performance of std::allocator::deallocate

2019-03-06 Thread Jonathan Wakely
On 06/03/19 09:20 +, Pádraig Brady wrote: On 03/06/2019 12:50 AM, Jonathan Wakely wrote: On 06/03/19 02:43 +, Pádraig Brady wrote: On 02/26/2019 04:23 PM, Padraig Brady wrote: Note jemalloc >= 5.1 is required to fix a bug with 0 sizes. How serious is the bug? What are the

Re: [PATCH] improve performance of std::allocator::deallocate

2019-03-06 Thread Pádraig Brady
On 03/06/2019 12:50 AM, Jonathan Wakely wrote: > On 06/03/19 02:43 +, Pádraig Brady wrote: >> >> >> On 02/26/2019 04:23 PM, Padraig Brady wrote: >>> Note jemalloc >= 5.1 is required to fix a bug with 0 sizes. How serious is the bug? What are the symptoms? >>> I've updated

Re: [PATCH] improve performance of std::allocator::deallocate

2019-03-06 Thread Jonathan Wakely
On 06/03/19 02:43 +, Pádraig Brady wrote: On 02/26/2019 04:23 PM, Padraig Brady wrote: Note jemalloc >= 5.1 is required to fix a bug with 0 sizes. How serious is the bug? What are the symptoms? I've updated the commit summary to say it's a crash. Arguably that's better than mem

Re: [PATCH] improve performance of std::allocator::deallocate

2019-03-05 Thread Pádraig Brady
On 02/26/2019 04:23 PM, Padraig Brady wrote: > >> Note jemalloc >= 5.1 is required to fix a bug with 0 sizes. >> >> How serious is the bug? What are the symptoms? >> > I've updated the commit summary to say it's a crash. > Arguably that's better than mem corruption. > >> It looks like 5.1.0 is

Re: [PATCH] improve performance of std::allocator::deallocate

2019-02-26 Thread Pádraig Brady
On 02/26/2019 05:50 AM, Jonathan Wakely wrote: > On 23/02/19 02:04 +, Pádraig Brady wrote: >> Attached is a simple patch which has been extensively tested within >> Facebook, >> and is enabled by default in our code base. >> >> Passing the size to the allocator allows it to optimize

Re: [PATCH] improve performance of std::allocator::deallocate

2019-02-26 Thread Jonathan Wakely
On 23/02/19 02:04 +, Pádraig Brady wrote: Attached is a simple patch which has been extensively tested within Facebook, and is enabled by default in our code base. Passing the size to the allocator allows it to optimize deallocation, and this was seen to significantly reduce the work

[PATCH] improve performance of std::allocator::deallocate

2019-02-22 Thread Pádraig Brady
Attached is a simple patch which has been extensively tested within Facebook, and is enabled by default in our code base. Passing the size to the allocator allows it to optimize deallocation, and this was seen to significantly reduce the work required in jemalloc, with about 40% reduction in CPU