Project

General

Profile

Feature #10949

Time is WB unprotected

Added by sylvain.joyeux (Sylvain Joyeux) over 5 years ago. Updated over 5 years ago.

Status:
Open
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:68459]

Description

Ruby's built-in Time object is shady. Unfortunately, it is an object that can commonly be created in big numbers (think logs or stuff like that), and since they don't store relationship with other objects they are perfect candidate for the oldgen.

I don't really know if there is a kind of policy about which built-in Ruby objects should be sunny or not, so I just put this as a feature request (as opposed to having it as a bug)

Updated by ko1 (Koichi Sasada) over 5 years ago

We use a terminology "WB unprotected object" (past we had said "shady object").

If there is a non-bug, perfect patch, it is welcome.

I didn't touch Time objects because I assume they are short-lived objects. If this assumption is not true, please tell me (with age data). You can check ages by allocation_tracer gem.

#2

Updated by sylvain.joyeux (Sylvain Joyeux) over 5 years ago

Koichi Sasada wrote:

If there is a non-bug, perfect patch, it is welcome.

The problem is that understanding what WB-protecting objects really entails is close to impossible. I've read README.ext time and time again, but really do not get what needs to be done. I've also sent a message on ruby-talk asking about clarifications, but nobody answered.

I didn't touch Time objects because I assume they are short-lived objects. If this assumption is not true, please tell me (with age data). You can check ages by allocation_tracer gem.

Simple: I process time-indexed data in which each sample is associated with a Time object (well, not anymore because the effect on the GC was pretty horrible). Which means: a few million Time objects with a lifetime of the whole run of my application (which means minutes, often).

Replacing Time with 64 bit integers shaved 25% off my running times. I would have preferred keeping the Time objects.

Updated by sylvain.joyeux (Sylvain Joyeux) over 5 years ago

  • Subject changed from Time is shady to Time is WB unprotected

@Koichi Sanada: could you guide me some hints to make Time WB-protected ? I really can't figure it out from the current documentation...

Also available in: Atom PDF