I made a script run 800% faster by using the Time class instead of the
DateTime class. You can see the scripts and more details at
http://www.recentrambles.com/pragmatic/view/33 Also, using a "memoize"
function whenever possible can greatly increase performance.
I'm still new to ruby, but what does this mean?
···
On Wed, 2006-03-15 at 03:53 +0900, Vincent Foley wrote:
* Using a Set instead of an Array when you only want to store unique
values can help make your code go faster
Charlie Bowman
http://www.recentrambles.com
The Set library is a standard library that comes with Ruby. I believe it uses rbtree if it can be loaded or a plain Hash otherwise, but it supports the expected set operations and keeps the contents unique.
James Edward Gray II
···
On Mar 14, 2006, at 12:59 PM, Charlie Bowman wrote:
I'm still new to ruby, but what does this mean?
Ah thanks about the Time class. The script I wrote deals with dates,
and I was using Date.strptime. Switching to Time.gm increased the
speed of the script by 4x.
Thanks, I'll look that up in the pickaxe book when I get home.
···
On Wed, 2006-03-15 at 04:04 +0900, James Edward Gray II wrote:
On Mar 14, 2006, at 12:59 PM, Charlie Bowman wrote:
> I'm still new to ruby, but what does this mean?
The Set library is a standard library that comes with Ruby. I
believe it uses rbtree if it can be loaded or a plain Hash otherwise,
but it supports the expected set operations and keeps the contents
unique.
James Edward Gray II
Charlie Bowman
Programmer
Castle Branch Inc.
when, oh when, will rbtree be in the core... sigh.
-a
···
On Wed, 15 Mar 2006, James Edward Gray II wrote:
On Mar 14, 2006, at 12:59 PM, Charlie Bowman wrote:
I'm still new to ruby, but what does this mean?
The Set library is a standard library that comes with Ruby. I believe it uses rbtree if it can be loaded or a plain Hash otherwise, but it supports the expected set operations and keeps the contents unique.
--
share your knowledge. it's a way to achieve immortality.
- h.h. the 14th dali lama
and it would be nice for it to have some more methods, like #slice! (a
destructive version of #bound).
···
ara.t.howard@noaa.gov wrote:
On Wed, 15 Mar 2006, James Edward Gray II wrote:
On Mar 14, 2006, at 12:59 PM, Charlie Bowman wrote:
I'm still new to ruby, but what does this mean?
The Set library is a standard library that comes with Ruby. I believe
it uses rbtree if it can be loaded or a plain Hash otherwise, but it
supports the expected set operations and keeps the contents unique.
when, oh when, will rbtree be in the core... sigh.
-a
--
vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407
Isn't it the library someone was complaining is broken in Ruby 1.8.4? We might need to fix it first. <laughs>
James Edward Gray II
···
On Mar 14, 2006, at 1:57 PM, ara.t.howard@noaa.gov wrote:
On Wed, 15 Mar 2006, James Edward Gray II wrote:
On Mar 14, 2006, at 12:59 PM, Charlie Bowman wrote:
I'm still new to ruby, but what does this mean?
The Set library is a standard library that comes with Ruby. I believe it uses rbtree if it can be loaded or a plain Hash otherwise, but it supports the expected set operations and keeps the contents unique.
when, oh when, will rbtree be in the core... sigh.
James Edward Gray II wrote:
Isn't it the library someone was complaining is broken in Ruby 1.8.4?
We might need to fix it first. <laughs>
Did you mean ruby-talk:183166 ? I've been using rbtree happily on 1.8.4.
···
--
vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407
Oops, yeah, my memory was poor on that one. It looks like it might be broken on 1.8.2, not 1.8.4. Sorry. My bad.
James Edward Gray II
···
On Mar 14, 2006, at 2:39 PM, Joel VanderWerf wrote:
James Edward Gray II wrote:
Isn't it the library someone was complaining is broken in Ruby 1.8.4?
We might need to fix it first. <laughs>
Did you mean ruby-talk:183166 ? I've been using rbtree happily on 1.8.4.