[#50466] [ruby-trunk - Bug #7492][Open] Segmentation fault at DL::TestDL#test_call_double on x64 Windows 8 — "phasis68 (Heesob Park)" <phasis@...>

23 messages 2012/12/02

[#50558] [ruby-trunk - Feature #7511][Open] short-circuiting logical implication operator — "rits (First Last)" <redmine@...>

12 messages 2012/12/04

[#50575] [ruby-trunk - Feature #7517][Open] Fixnum::MIN,MAX — "matz (Yukihiro Matsumoto)" <matz@...>

20 messages 2012/12/05

[#50755] Becoming a committer — Charlie Somerville <charlie@...>

Hi ruby-core,

21 messages 2012/12/11
[#50759] Re: Becoming a committer — Yukihiro Matsumoto <matz@...> 2012/12/11

Hi,

[#50784] Re: Becoming a committer — Charles Oliver Nutter <headius@...> 2012/12/11

It's really this easy? If so, I'll send over my public key today :)

[#50795] Re: Becoming a committer — Yukihiro Matsumoto <matz@...> 2012/12/11

Hi,

[#50806] [ruby-trunk - Feature #7548][Open] Load and Require Callbacks — "trans (Thomas Sawyer)" <transfire@...>

12 messages 2012/12/12

[#50810] [ruby-trunk - Feature #7549][Open] A Ruby Design Process — "brixen (Brian Ford)" <brixen@...>

34 messages 2012/12/12

[#50867] [ruby-trunk - Bug #7556][Assigned] test error on refinement — "usa (Usaku NAKAMURA)" <usa@...>

14 messages 2012/12/13

[#50900] [ruby-trunk - Bug #7564][Open] r38175 introduces incompatibility — "tenderlovemaking (Aaron Patterson)" <aaron@...>

14 messages 2012/12/14

[#50951] [ruby-trunk - Bug #7584][Open] Ruby hangs when shutting down an ssl connection in gc finalization — "bpot (Bob Potter)" <bobby.potter@...>

12 messages 2012/12/17

[#51076] [ruby-trunk - Feature #7604][Open] Make === comparison operator ability to delegate comparison to an argument — "prijutme4ty (Ilya Vorontsov)" <prijutme4ty@...>

12 messages 2012/12/22

[#51170] [ruby-trunk - Bug #7629][Open] Segmentation fault — "atd (Antonio Tapiador)" <atapiador@...>

13 messages 2012/12/28

[ruby-core:50543] [ruby-trunk - Bug #7500] Improve GC profiler timings on linux

From: "tmm1 (Aman Gupta)" <ruby@...1.net>
Date: 2012-12-04 01:04:34 UTC
List: ruby-core #50543
Issue #7500 has been updated by tmm1 (Aman Gupta).


 tmm1@fe19:~$ uname -a
 Linux fe19.rs.github.com 3.5.0-17-generic #28-Ubuntu SMP Tue Oct 9 19:31:23 UTC 2012 x86_64 GNU/Linux
 
 tmm1@fe19:~$ cat timings.c 
 #include <stdlib.h>
 #include <stdio.h>
 #include <sys/resource.h>
 #include <time.h>
 #include <math.h>
 
 double getrusage_time() {
 struct rusage usage;
 struct timeval time;
 getrusage(RUSAGE_SELF, &usage);
 time = usage.ru_utime;
 return time.tv_sec + time.tv_usec * 1e-6;
 }
 
 double clock_time() {
 struct timespec ts;
 
 if (clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &ts) == 0) {
 return ts.tv_sec + ts.tv_nsec * 1e-9;
 }
 return 0.0;
 }
 
 int main() {
 int n;
 
 printf("getrusage() before: %f\n", getrusage_time());
 for (n=0; n<10000; n++) pow(2, 2048);
 printf("getrusage() after: %f\n", getrusage_time());
 
 printf("clock_gettime() before: %f\n", clock_time());
 for (n=0; n<10000; n++) pow(2, 2048);
 printf("clock_gettime() after: %f\n", clock_time());
 }
 
 tmm1@fe19:~$ gcc -o timings timings.c -lrt
 
 tmm1@fe19:~$ ./timings 
 getrusage() before: 0.000000
 getrusage() after: 0.000000
 clock_gettime() before: 0.001244
 clock_gettime() after: 0.001358
 
----------------------------------------
Bug #7500: Improve GC profiler timings on linux
https://bugs.ruby-lang.org/issues/7500#change-34386

Author: tmm1 (Aman Gupta)
Status: Open
Priority: Normal
Assignee: authorNari (Narihiro Nakamura)
Category: core
Target version: 2.0.0
ruby -v: ruby 2.0.0dev (2012-12-03 trunk 38149) [x86_64-darwin12.2.0]


On linux kernels, getrusage()'s precision depends on the value of HZ when the kernel was compiled. By default, HZ=250 provides a 4ms granularity.

This patch uses clock_gettime() with CLOCK_PROCESS_CPUTIME_ID when available, which provides a 1ns precision on linux.


-- 
http://bugs.ruby-lang.org/

In This Thread