[ruby-core:68876] [Ruby trunk - Feature #10949] Time is shady

From: sylvain.joyeux@...4x.org
Date: 2015-04-13 15:43:18 UTC
List: ruby-core #68876
Issue #10949 has been updated by Sylvain Joyeux.


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.


----------------------------------------
Feature #10949: Time is shady
https://bugs.ruby-lang.org/issues/10949#change-52145

* Author: Sylvain Joyeux
* Status: Open
* Priority: Normal
* Assignee: 
----------------------------------------
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)



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

In This Thread

Prev Next