Re: gettimeofday is at the end of its usefulness?

Поиск
Список
Период
Сортировка
Искать
От
Benedikt Grundmann
Тема
Re: gettimeofday is at the end of its usefulness?
Дата
в 07:19:27
Msg-id
CADbMkNPEgbP_GThAvUdFu048zUpVGBHOeODUfGPKiEM-a4GXMw@mail.gmail.com
Ответ на
Список
Дерево обсуждения
gettimeofday is at the end of its usefulness? Tom Lane <tgl@sss.pgh.pa.us>
Re: gettimeofday is at the end of its usefulness? Andres Freund <andres@2ndquadrant.com>
Re: gettimeofday is at the end of its usefulness? Bruce Momjian <bruce@momjian.us>
Re: gettimeofday is at the end of its usefulness? Thom Brown <thom@linux.com>
Re: gettimeofday is at the end of its usefulness? Tom Lane <tgl@sss.pgh.pa.us>
Re: gettimeofday is at the end of its usefulness? Jim Nasby <Jim.Nasby@BlueTreble.com>
Re: gettimeofday is at the end of its usefulness? Robert Haas <robertmhaas@gmail.com>
Re: gettimeofday is at the end of its usefulness? Andres Freund <andres@anarazel.de>
Re: gettimeofday is at the end of its usefulness? Haribabu Kommi <kommi.haribabu@gmail.com>
Re: gettimeofday is at the end of its usefulness? Haribabu Kommi <kommi.haribabu@gmail.com>
Re: [HACKERS] gettimeofday is at the end of its usefulness? Tom Lane <tgl@sss.pgh.pa.us>
Re: [HACKERS] gettimeofday is at the end of its usefulness? Florian Weimer <fw@deneb.enyo.de>
Re: [HACKERS] gettimeofday is at the end of its usefulness? Tom Lane <tgl@sss.pgh.pa.us>
Re: [HACKERS] gettimeofday is at the end of its usefulness? Florian Weimer <fw@deneb.enyo.de>
Re: [HACKERS] gettimeofday is at the end of its usefulness? Tom Lane <tgl@sss.pgh.pa.us>
Re: [HACKERS] gettimeofday is at the end of its usefulness? Thomas Munro <thomas.munro@enterprisedb.com>
Re: [HACKERS] gettimeofday is at the end of its usefulness? Tom Lane <tgl@sss.pgh.pa.us>
Re: [HACKERS] gettimeofday is at the end of its usefulness? Greg Stark <stark@mit.edu>
Re: [HACKERS] gettimeofday is at the end of its usefulness? Andres Freund <andres@anarazel.de>
Re: [HACKERS] gettimeofday is at the end of its usefulness? Tom Lane <tgl@sss.pgh.pa.us>
Re: [HACKERS] gettimeofday is at the end of its usefulness? Tom Lane <tgl@sss.pgh.pa.us>
Re: [HACKERS] gettimeofday is at the end of its usefulness? Haribabu Kommi <kommi.haribabu@gmail.com>
Re: gettimeofday is at the end of its usefulness? Greg Stark <stark@mit.edu>
Re: gettimeofday is at the end of its usefulness? Tom Lane <tgl@sss.pgh.pa.us>
Re: gettimeofday is at the end of its usefulness? Ants Aasma <ants@cybertec.at>
Re: gettimeofday is at the end of its usefulness? Robert Haas <robertmhaas@gmail.com>
Re: gettimeofday is at the end of its usefulness? Benedikt Grundmann <bgrundmann@janestreet.com>
Re: gettimeofday is at the end of its usefulness? Benedikt Grundmann <bgrundmann@janestreet.com>
Re: gettimeofday is at the end of its usefulness? Greg Stark <stark@mit.edu>
Re: gettimeofday is at the end of its usefulness? Benedikt Grundmann <bgrundmann@janestreet.com>
Re: gettimeofday is at the end of its usefulness? Andres Freund <andres@2ndquadrant.com>
Re: gettimeofday is at the end of its usefulness? Peter Geoghegan <pg@heroku.com>
Re: gettimeofday is at the end of its usefulness? Tom Lane <tgl@sss.pgh.pa.us>
Re: gettimeofday is at the end of its usefulness? Jeff Janes <jeff.janes@gmail.com>
I posted this on this mailing list before at Jane Street we have developed very fast code to get timing information based on TSC if available.  It's all ocaml but well documented and mostly just calls to c functions so should be easy to port to C and we release it under a very liberal license so it should be no problem to take the ideas:

https://github.com/janestreet/core/blob/master/lib/time_stamp_counter.mli

Hope this is useful.

Bene


On Wed, May 14, 2014 at 12:41 PM, Robert Haas <robertmhaas@gmail.com> wrote:
On Tue, May 13, 2014 at 11:34 PM, Greg Stark <stark@mit.edu> wrote:
> I always assumed the kernel used rdtsc to implement some of the high
> performance timers. It can save the current time in a mapped page when
> it schedules a process and then in the vdso syscall (ie in user-space)
> it can use rdtsc to calculate the offset needed to adjust that
> timestamp to the current time. This seems consistent with your
> calculations that showed the 40ns overhead with +/- 10ns precision.

Crazy idea: Instead of trying to time precisely the amount of time we
spend in each node, configure a very-high frequency timer interrupt
(or background thread?) that does:

SomeGlobalVariablePointingToTheCurrentNode->profiling_counter++;

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


--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

В списке pgsql-hackers по дате отправления
От: Amit Kapila
Дата:
Сообщение: Scaling shared buffer eviction
От: Benedikt Grundmann
Дата:
FAQ