Обсуждение: Re: pgsql: Add documentation for the JIT feature.

Поиск
Список
Период
Сортировка

Re: pgsql: Add documentation for the JIT feature.

От
Alvaro Herrera
Дата:
Moving thread to pgsql-hackers.

Simon Riggs wrote:
> On 28 March 2018 at 22:23, Andres Freund <andres@anarazel.de> wrote:
> 
> > Add documentation for the JIT feature.
> 
> Very nice feature and most welcome but we should call it something
> other than just "JIT"
> 
> JIT means Just In Time, which could be applied to many concepts and
> has been in use for many years in a range of concepts. particularly in
> manufacturing/logistics and project management.

I agree.  In some email threads Andres has been using "JIT" as a verb,
too, such as "JITing expressions" and such; that's a bit shocking, in a
way.  Honestly I don't care in a pgsql-hackers thread, I mean we all
understand what it means, but in user-facing docs and things we should
use complete words, "JIT-compile", "JIT-compilation", "JIT-compiling"
and so on.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


Re: pgsql: Add documentation for the JIT feature.

От
John Naylor
Дата:
> I agree.  In some email threads Andres has been using "JIT" as a verb,
> too, such as "JITing expressions" and such; that's a bit shocking, in a
> way.  Honestly I don't care in a pgsql-hackers thread, I mean we all
> understand what it means, but in user-facing docs and things we should
> use complete words, "JIT-compile", "JIT-compilation", "JIT-compiling"
> and so on.

Earlier today, I did some web searches to determine how people spell
"JITed" (Andres' spelling), and also found JITted, JIT-ed, JIT'd, and
jitted. No one agrees on that, but it seems very common to use "JIT"
as a verb. See the LLVM docs:

https://llvm.org/docs/DebuggingJITedCode.html

-John Naylor


Re: pgsql: Add documentation for the JIT feature.

От
Alvaro Herrera
Дата:
John Naylor wrote:
> > I agree.  In some email threads Andres has been using "JIT" as a verb,
> > too, such as "JITing expressions" and such; that's a bit shocking, in a
> > way.  Honestly I don't care in a pgsql-hackers thread, I mean we all
> > understand what it means, but in user-facing docs and things we should
> > use complete words, "JIT-compile", "JIT-compilation", "JIT-compiling"
> > and so on.
> 
> Earlier today, I did some web searches to determine how people spell
> "JITed" (Andres' spelling), and also found JITted, JIT-ed, JIT'd, and
> jitted. No one agrees on that, but it seems very common to use "JIT"
> as a verb.

Yes: among compiler writers, people who are swimming in jitted bytes all
day long -- a tough bunch if I've seen any.  (Not that us here are
sparrows, mind.)

I meant that our docs are for normal people, not *them*.

(I too was thinking about the double 't' there while drafting the above
but decided to leave that concern out.)

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


Re: pgsql: Add documentation for the JIT feature.

От
Tom Lane
Дата:
Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> Simon Riggs wrote:
>> JIT means Just In Time, which could be applied to many concepts and
>> has been in use for many years in a range of concepts. particularly in
>> manufacturing/logistics and project management.

> I agree.  In some email threads Andres has been using "JIT" as a verb,
> too, such as "JITing expressions" and such; that's a bit shocking, in a
> way.  Honestly I don't care in a pgsql-hackers thread, I mean we all
> understand what it means, but in user-facing docs and things we should
> use complete words, "JIT-compile", "JIT-compilation", "JIT-compiling"
> and so on.

I'd go a little further and drop "JIT" from user-facing documentation
altogether.  Instead refer to the feature as "compilation of expressions"
or some such.  JIT is just jargon.  Plus, the timing of the compilation is
actually the least important property for our purpose.

            regards, tom lane


Re: pgsql: Add documentation for the JIT feature.

От
Stephen Frost
Дата:
Greetings Tom, all,

* Tom Lane (tgl@sss.pgh.pa.us) wrote:
> Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> > Simon Riggs wrote:
> >> JIT means Just In Time, which could be applied to many concepts and
> >> has been in use for many years in a range of concepts. particularly in
> >> manufacturing/logistics and project management.
>
> > I agree.  In some email threads Andres has been using "JIT" as a verb,
> > too, such as "JITing expressions" and such; that's a bit shocking, in a
> > way.  Honestly I don't care in a pgsql-hackers thread, I mean we all
> > understand what it means, but in user-facing docs and things we should
> > use complete words, "JIT-compile", "JIT-compilation", "JIT-compiling"
> > and so on.
>
> I'd go a little further and drop "JIT" from user-facing documentation
> altogether.  Instead refer to the feature as "compilation of expressions"
> or some such.  JIT is just jargon.  Plus, the timing of the compilation is
> actually the least important property for our purpose.

Agreed.

Thanks!

Stephen

Вложения

Re: pgsql: Add documentation for the JIT feature.

От
David Steele
Дата:
On 3/29/18 9:51 AM, Stephen Frost wrote:
> Greetings Tom, all,
>
> * Tom Lane (tgl@sss.pgh.pa.us) wrote:
>> Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
>>> Simon Riggs wrote:
>>>> JIT means Just In Time, which could be applied to many concepts and
>>>> has been in use for many years in a range of concepts. particularly in
>>>> manufacturing/logistics and project management.
>>
>>> I agree.  In some email threads Andres has been using "JIT" as a verb,
>>> too, such as "JITing expressions" and such; that's a bit shocking, in a
>>> way.  Honestly I don't care in a pgsql-hackers thread, I mean we all
>>> understand what it means, but in user-facing docs and things we should
>>> use complete words, "JIT-compile", "JIT-compilation", "JIT-compiling"
>>> and so on.
>>
>> I'd go a little further and drop "JIT" from user-facing documentation
>> altogether.  Instead refer to the feature as "compilation of expressions"
>> or some such.  JIT is just jargon.  Plus, the timing of the compilation is
>> actually the least important property for our purpose.
>
> Agreed.

+1. Or simply "expression compilation".

--
-David
david@pgmasters.net


Вложения

Re: pgsql: Add documentation for the JIT feature.

От
Robert Haas
Дата:
On Thu, Mar 29, 2018 at 9:44 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> I'd go a little further and drop "JIT" from user-facing documentation
> altogether.  Instead refer to the feature as "compilation of expressions"
> or some such.  JIT is just jargon.  Plus, the timing of the compilation is
> actually the least important property for our purpose.

I agree that talking about JIT compilation (or just-in-time
compilation) would be better than talking just about JIT, but refusing
to mention JIT seems counter-productive to me.  There are a lot of
people who know what just-in-time compilation is and will not realize
that "compilation of expressions" refers to any such technology.  If
you don't know what it is, you can Google it.  Just typing "jit" into
Google produces a stupid urban dictionary hit and then this:
https://en.wikipedia.org/wiki/Just-in-time_compilation  -- and that
contains useful information that you'll never find if you search for
"compilation of expressions".

Also, in a way, you could argue that v10 already did "compilation of
expressions".  It didn't compile them to machine language, true, but
it translated them into a form which is faster to execute, and which
is at least arguably a form of bytecode.  It's not going to be clear,
even to an expert, that "compilation of expressions" means something
other than that, but if you say JIT, then all of a sudden people know
what we're talking about.

I agree that JIT is jargon, but it's pretty commonly-used jargon.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: pgsql: Add documentation for the JIT feature.

От
Andres Freund
Дата:
On 2018-03-29 13:26:31 -0400, Robert Haas wrote:
> On Thu, Mar 29, 2018 at 9:44 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> > I'd go a little further and drop "JIT" from user-facing documentation
> > altogether.  Instead refer to the feature as "compilation of expressions"
> > or some such.  JIT is just jargon.  Plus, the timing of the compilation is
> > actually the least important property for our purpose.
> 
> I agree that talking about JIT compilation (or just-in-time
> compilation) would be better than talking just about JIT, but refusing
> to mention JIT seems counter-productive to me.  There are a lot of
> people who know what just-in-time compilation is and will not realize
> that "compilation of expressions" refers to any such technology.  If
> you don't know what it is, you can Google it.  Just typing "jit" into
> Google produces a stupid urban dictionary hit and then this:
> https://en.wikipedia.org/wiki/Just-in-time_compilation  -- and that
> contains useful information that you'll never find if you search for
> "compilation of expressions".
> 
> Also, in a way, you could argue that v10 already did "compilation of
> expressions".  It didn't compile them to machine language, true, but
> it translated them into a form which is faster to execute, and which
> is at least arguably a form of bytecode.  It's not going to be clear,
> even to an expert, that "compilation of expressions" means something
> other than that, but if you say JIT, then all of a sudden people know
> what we're talking about.
> 
> I agree that JIT is jargon, but it's pretty commonly-used jargon.

Precisely this. I'm very strongly against just saying "expression
compilation", it's just too imprecise. As Robert mentions it could refer
to what we do in v10, it could refer to ahead of time compilation of PL
functions, and it doesn't include compiling tuple deforming.  Nor will
it describe compiling sorting, copy or whatnot.

I'm very open however to replacing JITing with JIT compiling and smilar
substitutions.

Greetings,

Andres Freund


Re: pgsql: Add documentation for the JIT feature.

От
Stephen Frost
Дата:
Greetings,

* Andres Freund (andres@anarazel.de) wrote:
> On 2018-03-29 13:26:31 -0400, Robert Haas wrote:
> > On Thu, Mar 29, 2018 at 9:44 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> > > I'd go a little further and drop "JIT" from user-facing documentation
> > > altogether.  Instead refer to the feature as "compilation of expressions"
> > > or some such.  JIT is just jargon.  Plus, the timing of the compilation is
> > > actually the least important property for our purpose.
> >
> > I agree that talking about JIT compilation (or just-in-time
> > compilation) would be better than talking just about JIT, but refusing
> > to mention JIT seems counter-productive to me.  There are a lot of
> > people who know what just-in-time compilation is and will not realize
> > that "compilation of expressions" refers to any such technology.  If
> > you don't know what it is, you can Google it.  Just typing "jit" into
> > Google produces a stupid urban dictionary hit and then this:
> > https://en.wikipedia.org/wiki/Just-in-time_compilation  -- and that
> > contains useful information that you'll never find if you search for
> > "compilation of expressions".
> >
> > Also, in a way, you could argue that v10 already did "compilation of
> > expressions".  It didn't compile them to machine language, true, but
> > it translated them into a form which is faster to execute, and which
> > is at least arguably a form of bytecode.  It's not going to be clear,
> > even to an expert, that "compilation of expressions" means something
> > other than that, but if you say JIT, then all of a sudden people know
> > what we're talking about.
> >
> > I agree that JIT is jargon, but it's pretty commonly-used jargon.
>
> Precisely this. I'm very strongly against just saying "expression
> compilation", it's just too imprecise. As Robert mentions it could refer
> to what we do in v10, it could refer to ahead of time compilation of PL
> functions, and it doesn't include compiling tuple deforming.  Nor will
> it describe compiling sorting, copy or whatnot.
>
> I'm very open however to replacing JITing with JIT compiling and smilar
> substitutions.

What we've done elsewhere when there's been similar jargon is to say
something along the lines of:

"compiling of routines (also known as Just-In-Time or JIT compilation)"

Thanks!

Stephen

Вложения

Re: pgsql: Add documentation for the JIT feature.

От
Robert Haas
Дата:
On Thu, Mar 29, 2018 at 3:00 PM, Stephen Frost <sfrost@snowman.net> wrote:
> What we've done elsewhere when there's been similar jargon is to say
> something along the lines of:
>
> "compiling of routines (also known as Just-In-Time or JIT compilation)"

That strike me as roughly analogous to saying:

"hiding rows users don't have permission to see (also known as
row-level security)"

IOW, it's just substituting a generic description for a term of art
that has a real meaning.  I can't see that as an improvement.  It
would be possible to compile routines without involving JIT; as I
mentioned earlier, you could compile them to bytecode. Or, you could
compile them to machine code at definition time as, I am told by
Thomas, some database products used to do, I think by generating C
code and then shelling out to "cc".  Just-in-time compilation clearly
conveys that we are generating machine code at runtime; "compiling of
routines" does not.

Besides, if we did that, what are we going to call the GUCs?
compiling_of_routines_above_cost?  compiling_of_routines_provider =
'llvmjit'?  Ugh.

This technique has bene called JIT since about 1983, and is well-known
under that name, mostly because of Java.  Calling it some made-up name
we create ourselves is not going to make this more comprehensible to
users.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: pgsql: Add documentation for the JIT feature.

От
Andres Freund
Дата:
On 2018-03-29 15:00:36 -0400, Stephen Frost wrote:
> Greetings,
>
> * Andres Freund (andres@anarazel.de) wrote:
> > On 2018-03-29 13:26:31 -0400, Robert Haas wrote:
> > > On Thu, Mar 29, 2018 at 9:44 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> > > > I'd go a little further and drop "JIT" from user-facing documentation
> > > > altogether.  Instead refer to the feature as "compilation of expressions"
> > > > or some such.  JIT is just jargon.  Plus, the timing of the compilation is
> > > > actually the least important property for our purpose.
> > >
> > > I agree that talking about JIT compilation (or just-in-time
> > > compilation) would be better than talking just about JIT, but refusing
> > > to mention JIT seems counter-productive to me.  There are a lot of
> > > people who know what just-in-time compilation is and will not realize
> > > that "compilation of expressions" refers to any such technology.  If
> > > you don't know what it is, you can Google it.  Just typing "jit" into
> > > Google produces a stupid urban dictionary hit and then this:
> > > https://en.wikipedia.org/wiki/Just-in-time_compilation  -- and that
> > > contains useful information that you'll never find if you search for
> > > "compilation of expressions".
> > >
> > > Also, in a way, you could argue that v10 already did "compilation of
> > > expressions".  It didn't compile them to machine language, true, but
> > > it translated them into a form which is faster to execute, and which
> > > is at least arguably a form of bytecode.  It's not going to be clear,
> > > even to an expert, that "compilation of expressions" means something
> > > other than that, but if you say JIT, then all of a sudden people know
> > > what we're talking about.
> > >
> > > I agree that JIT is jargon, but it's pretty commonly-used jargon.
> >
> > Precisely this. I'm very strongly against just saying "expression
> > compilation", it's just too imprecise. As Robert mentions it could refer
> > to what we do in v10, it could refer to ahead of time compilation of PL
> > functions, and it doesn't include compiling tuple deforming.  Nor will
> > it describe compiling sorting, copy or whatnot.
> >
> > I'm very open however to replacing JITing with JIT compiling and smilar
> > substitutions.
>
> What we've done elsewhere when there's been similar jargon is to say
> something along the lines of:
>
> "compiling of routines (also known as Just-In-Time or JIT compilation)"

There's an entire section explaining what JIT is and what we currently
can JIT.  We can't just say "compiling of routines (also ...)", because
a) we don't do that. b) even if you take expressions being JIT compiled
as that, we also JIT compile tuple deforming. And hopefully will JIT
further things in the not too far away future.

The general config.sgml references and such read
        Sets the planner's cutoff above which JIT compilation is used as part
        of query execution (see <xref linkend="jit"/>). Performing
        <acronym>JIT</acronym> costs time but can accelerate query execution.
it's not used in a standalone manner without references.

and the jit specific section starts with:
  <para>
   Just-in-time compilation (<acronym>JIT</acronym>) is the process of turning
   some form of interpreted program evaluation into a native program, and
   doing so at runtime.

   For example, instead of using a facility that can evaluate arbitrary SQL
   expressions to evaluate an SQL predicate like <literal>WHERE a.col =
   3</literal>, it is possible to generate a function than can be natively
   executed by the CPU that just handles that expression, yielding a speedup.
  </para>

and continues a bit later with
  <sect2 id="jit-accelerated-operations">
   <title><acronym>JIT</acronym> Accelerated Operations</title>
   <para>
    Currently <productname>PostgreSQL</productname>'s <acronym>JIT</acronym>
    implementation has support for accelerating expression evaluation and
    tuple deforming.  Several other operations could be accelerated in the
    future.
   </para>
   <para>
    Expression evaluation is used to evaluate <literal>WHERE</literal>
    clauses, target lists, aggregates and projections. It can be accelerated
    by generating code specific to each case.
   </para>
   <para>
    Tuple deforming is the process of transforming an on-disk tuple (see <xref
    linkend="heaptuple"/>) into its in-memory representation. It can be
    accelerated by creating a function specific to the table layout and the
    number of columns to be extracted.
   </para>
  </sect2>

I think there's a few references to standalone JIT that deserve to be
replaced with JIT compilation and similar.

Greetings,

Andres Freund


Re: pgsql: Add documentation for the JIT feature.

От
"David G. Johnston"
Дата:
On Thursday, March 29, 2018, Andres Freund <andres@anarazel.de> wrote:
On 2018-03-29 13:26:31 -0400, Robert Haas wrote:

> Also, in a way, you could argue that v10 already did "compilation of
> expressions".  It didn't compile them to machine language, true, but
> it translated them into a form which is faster to execute, and which
> is at least arguably a form of bytecode.  It's not going to be clear,
> even to an expert, that "compilation of expressions" means something
> other than that, but if you say JIT, then all of a sudden people know
> what we're talking about.
>
> I agree that JIT is jargon, but it's pretty commonly-used jargon.

Precisely this. I'm very strongly against just saying "expression
compilation", it's just too imprecise. As Robert mentions it could refer
to what we do in v10, it could refer to ahead of time compilation of PL
functions, and it doesn't include compiling tuple deforming.  Nor will
it describe compiling sorting, copy or whatnot.

I'm very open however to replacing JITing with JIT compiling and smilar
substitutions.


FWIW "JIT expression compilation" is comprehensible and precise to me.

David J.

Re: pgsql: Add documentation for the JIT feature.

От
Peter Geoghegan
Дата:
On Thu, Mar 29, 2018 at 12:22 PM, Robert Haas <robertmhaas@gmail.com> wrote:
> This technique has bene called JIT since about 1983, and is well-known
> under that name, mostly because of Java.  Calling it some made-up name
> we create ourselves is not going to make this more comprehensible to
> users.

+1. You make a good point about Java. Furthermore, when people talk
about just in time compilation in database systems, which is far from
a novel thing, they generally use the word JIT.

Why confuse things?

-- 
Peter Geoghegan


Re: pgsql: Add documentation for the JIT feature.

От
David Steele
Дата:
On 3/29/18 3:27 PM, Andres Freund wrote:
> 
> There's an entire section explaining what JIT is and what we currently
> can JIT.  We can't just say "compiling of routines (also ...)", because
> a) we don't do that. b) even if you take expressions being JIT compiled
> as that, we also JIT compile tuple deforming. And hopefully will JIT
> further things in the not too far away future.

OK, I'm convinced.

-- 
-David
david@pgmasters.net


Re: pgsql: Add documentation for the JIT feature.

От
Andres Freund
Дата:
Hi,

On 2018-03-29 09:59:55 -0300, Alvaro Herrera wrote:
> I agree.  In some email threads Andres has been using "JIT" as a verb,
> too, such as "JITing expressions" and such; that's a bit shocking, in a
> way.  Honestly I don't care in a pgsql-hackers thread, I mean we all
> understand what it means, but in user-facing docs and things we should
> use complete words, "JIT-compile", "JIT-compilation", "JIT-compiling"
> and so on.

FWIW, I don't think "JITing" or "JITed" appears anywhere in user facing
docs?

Greetings,

Andres Freund