So nil# is just some cryptic internal function. tbh I thought it might be
but wanted to confirm. It is annoying that it takes up so much of the run
time
I was trying to make sense of the cost of Time.now.to_i In an application I
have this gets called a lot. Time object gets created, to_i is called and
the Time object is immediately discarded. Just wanted to get a feel for how
wasteful that might be. A ffi to a C function that just returns the rawtime
as an int (long in C) is faster
But adding a C function is it's own complexity for maintenance and
deployment
So nil# is just some cryptic internal function. tbh I thought it might be
but wanted to confirm. It is annoying that it takes up so much of the run
time
I believe Frank is saying that the report uses standard Ruby
"<Class>#<method_name>" notation for telling us what method is being
called. Because it's a Proc, there's no Class (i.e. nil), and no method
name (i.e. empty string), thus: `nil#`
I was trying to make sense of the cost of Time.now.to_i In an application
I have this gets called a lot. Time object gets created, to_i is called and
the Time object is immediately discarded. Just wanted to get a feel for how
wasteful that might be. A ffi to a C function that just returns the rawtime
as an int (long in C) is faster
But adding a C function is it's own complexity for maintenance and
deployment
Rehearsal ---------------------------------------------
time 0.860677 0.331028 1.191705 ( 1.236668)
late 0.077804 0.000000 0.077804 ( 0.078566)
timestamp 0.075141 0.000000 0.075141 ( 0.075973)
process 0.444969 0.303556 0.748525 ( 0.768514)
------------------------------------ total: 2.093175sec
user system total real
time 0.826468 0.332544 1.159012 ( 1.181181)
late 0.076836 0.000000 0.076836 ( 0.077193)
timestamp 0.076191 0.000000 0.076191 ( 0.076319)
process 0.454212 0.328651 0.782863 ( 0.793092)
···
On 10/29/21, Peter Hickman <peterhickman386@googlemail.com> wrote:
I was trying to make sense of the cost of Time.now.to_i In an application I
have this gets called a lot. Time object gets created, to_i is called and
the Time object is immediately discarded. Just wanted to get a feel for how
wasteful that might be. A ffi to a C function that just returns the rawtime
as an int (long in C) is faster
But adding a C function is it's own complexity for maintenance and
deployment
So nil# is just some cryptic internal function. tbh I thought it might be
but wanted to confirm. It is annoying that it takes up so much of the run
time
I believe Frank is saying that the report uses standard Ruby
"<Class>#<method_name>" notation for telling us what method is being
called. Because it's a Proc, there's no Class (i.e. nil), and no method
name (i.e. empty string), thus: `nil#`
I was trying to make sense of the cost of Time.now.to_i In an application
I have this gets called a lot. Time object gets created, to_i is called and
the Time object is immediately discarded. Just wanted to get a feel for how
wasteful that might be. A ffi to a C function that just returns the rawtime
as an int (long in C) is faster
But adding a C function is it's own complexity for maintenance and
deployment
Ah, I thought that something like this (Process.clock_gettime) should exist
but I was looking in the Time class and searching for things like rawtime.
Thanks that I exactly what I am looking for
···
On Sat, 30 Oct 2021 at 01:12, Matthew Kerwin <matthew@kerwin.net.au> wrote:
On Sat, Oct 30, 2021 at 7:10 AM Peter Hickman < > peterhickman386@googlemail.com> wrote:
Seriously... Don't use it. Use stackprof for profiling and use benchmark-ips for comparative benchmarking.
···
On Oct 30, 2021, at 00:20, Peter Hickman <peterhickman386@googlemail.com> wrote:
On Sat, 30 Oct 2021 at 01:12, Matthew Kerwin <matthew@kerwin.net.au> wrote:
On Sat, Oct 30, 2021 at 7:10 AM Peter Hickman <peterhickman386@googlemail.com> wrote:
So nil# is just some cryptic internal function. tbh I thought it might be but wanted to confirm. It is annoying that it takes up so much of the run time
I believe Frank is saying that the report uses standard Ruby "<Class>#<method_name>" notation for telling us what method is being called. Because it's a Proc, there's no Class (i.e. nil), and no method name (i.e. empty string), thus: `nil#`
I was trying to make sense of the cost of Time.now.to_i In an application I have this gets called a lot. Time object gets created, to_i is called and the Time object is immediately discarded. Just wanted to get a feel for how wasteful that might be. A ffi to a C function that just returns the rawtime as an int (long in C) is faster
But adding a C function is it's own complexity for maintenance and deployment
Ah, I thought that something like this (Process.clock_gettime) should exist but I was looking in the Time class and searching for things like rawtime. Thanks that I exactly what I am looking for