[#5322] O(1) performance for insertions/deletions at the front of an Array/String — Eric Mahurin <eric_mahurin@...>

I just did some benchmarks on push, pop, shift, and unshift

24 messages 2005/07/01
[#5338] Re: O(1) performance for insertions/deletions at the front of an Array/String — Mathieu Bouchard <matju@...> 2005/07/02

On Fri, 1 Jul 2005, Eric Mahurin wrote:

[#5348] Re: O(1) performance for insertions/deletions at the front of an Array/String — Eric Mahurin <eric_mahurin@...> 2005/07/02

--- Mathieu Bouchard <matju@artengine.ca> wrote:

[#5357] Re: O(1) performance for insertions/deletions at the front of an Array/String — Mathieu Bouchard <matju@...> 2005/07/03

On Sat, 2 Jul 2005, Eric Mahurin wrote:

[#5359] Re: O(1) performance for insertions/deletions at the front of an Array/String — Eric Mahurin <eric_mahurin@...> 2005/07/03

--- Mathieu Bouchard <matju@artengine.ca> wrote:

[#5361] Re: O(1) performance for insertions/deletions at the front of an Array/String — Mathieu Bouchard <matju@...> 2005/07/03

On Sun, 3 Jul 2005, Eric Mahurin wrote:

[#5362] Re: O(1) performance for insertions/deletions at the front of an Array/String — Eric Mahurin <eric_mahurin@...> 2005/07/03

--- Mathieu Bouchard <matju@artengine.ca> wrote:

[#5365] Re: O(1) performance for insertions/deletions at the front of an Array/String — Yukihiro Matsumoto <matz@...> 2005/07/04

Hi,

[#5367] Re: O(1) performance for insertions/deletions at the front of an Array/String — Eric Mahurin <eric_mahurin@...> 2005/07/04

--- Yukihiro Matsumoto <matz@ruby-lang.org> wrote:

[#5368] Re: O(1) performance for insertions/deletions at the front of an Array/String — Yukihiro Matsumoto <matz@...> 2005/07/04

Hi,

[#5372] Re: O(1) performance for insertions/deletions at the front of an Array/String — Florian Gro<florgro@...> 2005/07/04

Yukihiro Matsumoto wrote:

[#5420] Sydney Developer Preview 1 released — Evan Webb <evanwebb@...>

Sydney, an experimental ruby interpreter, has been released!

15 messages 2005/07/11
[#5424] Re: [ANN] Sydney Developer Preview 1 released — Evan Webb <evanwebb@...> 2005/07/12

Thanks everyone for the feedback so far!

Multiline Regexp Bug

From: xsdg <xsdg@...>
Date: 2005-07-21 07:05:38 UTC
List: ruby-core #5496
I was working on untangling some data for someone in #ruby-lang, and I think I
found a bug in the Regexp multiline support.

irb(main):001:0> "a=12\nb=23\nc=34\nd=45\n".scan(/(?:[^=]+=.+)+/)
=> ["a=12\nb=23\nc=34\nd=45"]
irb(main):002:0> "a=12\nb=23\nc=34\nd=45\n".scan(/(?:      .+)+/x)
=> ["a=12", "b=23", "c=34", "d=45"]
irb(main):003:0> "a=12\nb=23\nc=34\nd=45\n".scan(/(?:.+)+/)
=> ["a=12", "b=23", "c=34", "d=45"]
irb(main):004:0> "a=12\nb=23\nc=34\nd=45\n".scan(/([^=]+=.+)+/)
=> [["\nd=45"]]
irb(main):005:0> "a=12\nb=23\nc=34\nd=45\n".scan(/(      .+)+/x)
=> [["a=12"], ["b=23"], ["c=34"], ["d=45"]]

In the first line, which demonstrates the bug, the trailing .+ should not grab
everything until the end of the string -- as the regexp is not in multiline
mode, it should return exactly the same thing as lines 2 and 3.  I included line
3 just to show that the //x option wasn't changing anything.  Additionally,
lines 4 and 5 show that the non-capturing nature of the parens in the first 3
lines is not to blame either.


$ruby --version; irb --version
ruby 1.8.2 (2005-01-10) [i386-linux]
irb 0.9(02/07/03)

$dpkg -l ruby1.8 irb1.8 libruby1.8
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name           Version        Description
+++-==============-==============-============================================
ii  ruby1.8        1.8.2-2        Interpreter of object-oriented scripting lan
ii  irb1.8         1.8.2-2        Interactive Ruby (for Ruby 1.8)
ii  libruby1.8     1.8.2-2        Libraries necessary to run the Ruby 1.8


--xsdg



In This Thread

Prev Next