All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Matt W. Benjamin" <matt@linuxbox.com>
To: Sage Weil <sage@inktank.com>
Cc: ceph-devel@vger.kernel.org
Subject: Re: optimizing buffers, encode/decode
Date: Wed, 29 Oct 2014 13:23:58 -0400 (EDT)	[thread overview]
Message-ID: <504191181.157.1414603437991.JavaMail.root@thunderbeast.private.linuxbox.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1410290957240.21856@cobra.newdream.net>

Hi Sage,

We're starting a round of work on improving encode/decode workload profiling, which we'll
share as soon as we have something informative.

Matt

----- "Sage Weil" <sage@inktank.com> wrote:

> We talked a bit about improving the performance encode/decode 
> yesterday at CDS:
> 
> 	http://pad.ceph.com/p/hammer-buffer_encoding
> 
> I think the main takeaways were:
> 
> 1- We need some up to date profiling information to see
> 
>   - how much of it is buffer-related functions (e.g., append)
>   - which data types are slowest or most frequently encoded (or
> otherwise 
>     show up in the profile)
> 
> 2- For now we should probably focus on the efficiency of the
> encode/decode 
> paths.  Possibilities include
> 
>   - making more things inline
>   - improving the past path
> 
> 3- Matt and the linuxbox folks have been playing with some general 
> optimizations for the buffer::list class.  These include combining 
> some of the function of ptr and raw so that, for the common 
> single-reference case, we chain the raw pointers together directly
> from 
> list using the boost intrusive list type, and fall back to the current
> 
> list -> ptr -> raw strategy when there are additional refs.
> 
> 
> For #2, one simple thought would be to cache a pointer and remaining
> bytes 
> or end pointer into the append_buffer directly in list so that we
> avoid 
> the duplicate asserts and size checks in the common append (encode)
> path.  
> Then a
> 
>   ::encode(myu64, bl);
> 
> would inline into something pretty quick, like
> 
>   remaining -= 8;
>   if (remainining < 0) { // take slow path
> 
>   } else {
>      *ptr = myu64;
>      ptr += 8;
>   }
> 
> Not sure if an end pointer would let us cut out the 2 arithmetic ops
> or 
> not.  Or if it even matters on modern pipelining processors.
> 
> Anyway, any gains we make here will pay dividends across the entire 
> code base.  And any profiling people want to do will help guide 
> things...
> 
> Thanks!
> sage
> --
> To unsubscribe from this list: send the line "unsubscribe ceph-devel"
> in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Matt Benjamin
The Linux Box
206 South Fifth Ave. Suite 150
Ann Arbor, MI  48104

http://linuxbox.com

tel.  734-761-4689 
fax.  734-769-8938 
cel.  734-216-5309 

  reply	other threads:[~2014-10-29 17:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-29 17:17 optimizing buffers, encode/decode Sage Weil
2014-10-29 17:23 ` Matt W. Benjamin [this message]
2014-10-29 17:33   ` Haomai Wang
2014-10-29 17:38     ` Matt W. Benjamin
2014-10-29 17:43     ` Sage Weil
2014-11-03  7:52 ` Aanchal Agrawal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=504191181.157.1414603437991.JavaMail.root@thunderbeast.private.linuxbox.com \
    --to=matt@linuxbox.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=sage@inktank.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.