Fix a couple of typos in JIT
Hi,
I was just looking over the JIT code and noticed a few comment and
documentation typos. The attached fixes them.
I'll push this in my UTC+12 morning if nobody objects to any of the
changes before then.
Unsure if it'll be worth backpatching or not.
David
Attachments:
fix_a_few_jit_typos.patchapplication/octet-stream; name=fix_a_few_jit_typos.patchDownload
diff --git a/src/backend/jit/README b/src/backend/jit/README
index e2fac8558e..1dcbdd0201 100644
--- a/src/backend/jit/README
+++ b/src/backend/jit/README
@@ -10,11 +10,10 @@ SQL expressions to evaluate an SQL predicate like WHERE a.col = 3, it
is possible to generate a function than can be natively executed by
the CPU that just handles that expression, yielding a speedup.
-That this is done at query execution time, possibly even only in cases
-where the relevant task is done a number of times, makes it JIT,
-rather than ahead-of-time (AOT). Given the way JIT compilation is used
-in PostgreSQL, the lines between interpretation, AOT and JIT are
-somewhat blurry.
+This is done at query execution time, possibly even only in cases where
+the relevant task is done a number of times, makes it JIT, rather than
+ahead-of-time (AOT). Given the way JIT compilation is used in PostgreSQL,
+the lines between interpretation, AOT and JIT are somewhat blurry.
Note that the interpreted program turned into a native program does
not necessarily have to be a program in the classical sense. E.g. it
@@ -99,7 +98,7 @@ Lifetimes of JITed functions are managed via JITContext. Exactly one
such context should be created for work in which all created JITed
function should have the same lifetime. E.g. there's exactly one
JITContext for each query executed, in the query's EState. Only the
-release of an JITContext is exposed to the provider independent
+release of a JITContext is exposed to the provider independent
facility, as the creation of one is done on-demand by the JIT
implementations.
@@ -231,7 +230,7 @@ needs to be referenced as an offset to one block of memory stored in
an ExprState, rather than absolute pointers into memory.
Once that is addressed, adding an LRU cache that's keyed by the
-generated LLVM IR will allow to use optimized functions even for
+generated LLVM IR will allow the usage of optimized functions even for
faster queries.
A longer term project is to move expression compilation to the planner
diff --git a/src/include/jit/llvmjit_emit.h b/src/include/jit/llvmjit_emit.h
index 1a7d6db725..3142df608b 100644
--- a/src/include/jit/llvmjit_emit.h
+++ b/src/include/jit/llvmjit_emit.h
@@ -1,6 +1,6 @@
/*
* llvmjit_emit.h
- * Helpers to make emitting LLVM IR a it more concise and pgindent proof.
+ * Helpers to make emitting LLVM IR a bit more concise and pgindent proof.
*
* Copyright (c) 2018-2020, PostgreSQL Global Development Group
*
At 2020-08-20 22:19:49 +1200, dgrowleyml@gmail.com wrote:
I was just looking over the JIT code and noticed a few comment and
documentation typos. The attached fixes them.
The first change does not seem to be correct:
-That this is done at query execution time, possibly even only in cases
-where the relevant task is done a number of times, makes it JIT,
-rather than ahead-of-time (AOT). Given the way JIT compilation is used
-in PostgreSQL, the lines between interpretation, AOT and JIT are
-somewhat blurry.
+This is done at query execution time, possibly even only in cases where
+the relevant task is done a number of times, makes it JIT, rather than
+ahead-of-time (AOT). Given the way JIT compilation is used in PostgreSQL,
+the lines between interpretation, AOT and JIT are somewhat blurry.
The original sentence may not be the most shining example of
sentence-ry, but it is correct, and removing the "That" breaks it.
-- Abhijit
On Thu, 20 Aug 2020 at 22:29, Abhijit Menon-Sen <ams@toroid.org> wrote:
At 2020-08-20 22:19:49 +1200, dgrowleyml@gmail.com wrote:
I was just looking over the JIT code and noticed a few comment and
documentation typos. The attached fixes them.The first change does not seem to be correct:
-That this is done at query execution time, possibly even only in cases -where the relevant task is done a number of times, makes it JIT, -rather than ahead-of-time (AOT). Given the way JIT compilation is used -in PostgreSQL, the lines between interpretation, AOT and JIT are -somewhat blurry. +This is done at query execution time, possibly even only in cases where +the relevant task is done a number of times, makes it JIT, rather than +ahead-of-time (AOT). Given the way JIT compilation is used in PostgreSQL, +the lines between interpretation, AOT and JIT are somewhat blurry.The original sentence may not be the most shining example of
sentence-ry, but it is correct, and removing the "That" breaks it.
Oh, I see. I missed that. Perhaps it would be better changed to "The
fact that this"
David
At 2020-08-20 22:51:41 +1200, dgrowleyml@gmail.com wrote:
+This is done at query execution time, possibly even only in cases where +the relevant task is done a number of times, makes it JIT, rather than +ahead-of-time (AOT). Given the way JIT compilation is used in PostgreSQL, +the lines between interpretation, AOT and JIT are somewhat blurry. […]Oh, I see. I missed that. Perhaps it would be better changed to "The
fact that this"
Or maybe even:
This is JIT, rather than ahead-of-time (AOT) compilation, because it
is done at query execution time, and perhaps only in cases where the
relevant task is repeated a number of times. Given the way …
-- Abhijit
Hi,
On 2020-08-20 15:59:26 +0530, Abhijit Menon-Sen wrote:
The original sentence may not be the most shining example of
sentence-ry, but it is correct, and removing the "That" breaks it.
That made me laugh ;)
David, sounds good, after adapting to Abhijit's concerns.
Greetings,
Andres Freund