[dovecot/core] 731192: lib: Implement i_realloc(mem==NULL) more efficient...

GitHub noreply at github.com
Fri Apr 29 11:30:11 UTC 2016


  Branch: refs/heads/master
  Home:   https://github.com/dovecot/core
  Commit: 7311925c65813a1902e41eb5aa397ee5b839d39e
      https://github.com/dovecot/core/commit/7311925c65813a1902e41eb5aa397ee5b839d39e
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2016-04-29 (Fri, 29 Apr 2016)

  Changed paths:
    M src/lib/mempool-system.c

  Log Message:
  -----------
  lib: Implement i_realloc(mem==NULL) more efficiently

Various parts of code use this to allocate the initial buffer. We can
do this more efficiently by using calloc().


  Commit: 50ae8852cb28b11b9589a4ed5f2b54b10b1ab591
      https://github.com/dovecot/core/commit/50ae8852cb28b11b9589a4ed5f2b54b10b1ab591
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2016-04-29 (Fri, 29 Apr 2016)

  Changed paths:
    M src/lib/buffer.c

  Log Message:
  -----------
  lib: Use p_malloc() explicitly in first buffer_alloc()

Although there is now code in p_realloc() that it should be just as
efficient, this makes profiling somewhat nicer since it can better
distinguish between actual reallocs and initial allocs.


  Commit: 09539f3db2f1b3e24f40844d8456b06d318d0fe7
      https://github.com/dovecot/core/commit/09539f3db2f1b3e24f40844d8456b06d318d0fe7
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2016-04-29 (Fri, 29 Apr 2016)

  Changed paths:
    M src/lib/buffer.c

  Log Message:
  -----------
  lib: buffer_create_dynamic() now adds +1 to init_size


  Commit: 749097cae4e02bdeccb8b09f7dda6e2da6812ee1
      https://github.com/dovecot/core/commit/749097cae4e02bdeccb8b09f7dda6e2da6812ee1
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2016-04-29 (Fri, 29 Apr 2016)

  Changed paths:
    M src/lib-index/mail-index-map.c

  Log Message:
  -----------
  lib-index: Use a bit larger initial records buffer size

For example with a mailbox having 160k messages the buffer size is around
10MB. Adding just 1% more space to it allows a lot more appends before the
buffer needs to be realloced. This reduces CPU usage quite a lot.


Compare: https://github.com/dovecot/core/compare/2386c9f53c26...749097cae4e0


More information about the dovecot-cvs mailing list