[#10853] Why limit class def to a constant or colon node? — Charles Oliver Nutter <charles.nutter@...>

Is there a historical reason why I can't do something like these:

12 messages 2007/04/03

[#10933] Cannot build with extra library path if previous version already installed — <noreply@...>

Bugs item #10140, was opened at 2007-04-16 17:32

10 messages 2007/04/16
[#10934] Re: [ ruby-Bugs-10140 ] Cannot build with extra library path if previous version already installed — nobu@... 2007/04/16

Hi,

[#10960] Re: [ ruby-Bugs-10140 ] Cannot build with extra library path if previous version already installed — "Michal Suchanek" <hramrach@...> 2007/04/18

On 4/16/07, nobu@ruby-lang.org <nobu@ruby-lang.org> wrote:

[#10967] Re: [ ruby-Bugs-10140 ] Cannot build with extra library path if previous version already installed — Nobuyoshi Nakada <nobu@...> 2007/04/19

Hi,

[#10970] Re: [ ruby-Bugs-10140 ] Cannot build with extra library path if previous version already installed — "Michal Suchanek" <hramrach@...> 2007/04/19

On 4/19/07, Nobuyoshi Nakada <nobu@ruby-lang.org> wrote:> Hi,>> At Wed, 18 Apr 2007 20:21:44 +0900,> Michal Suchanek wrote in [ruby-core:10960]:> > Yes. And this should also apply to extensions. The mkmf tests are now> > fine but the extension is linked with -L/sw/lib before -L../..>> Indeed.>>> Index: configure.in> ===================================================================> --- configure.in (revision 12191)> +++ configure.in (working copy)> @@ -1385,5 +1385,4 @@ if test "$enable_rpath" = yes; then> fi>> -LDFLAGS="-L. $LDFLAGS"> AC_SUBST(ARCHFILE)>This would break the previous fix so I did not even try to apply this ^

[#11003] miniruby loads extensions from already installed ruby — <noreply@...>

Bugs item #10303, was opened at 2007-04-23 10:44

10 messages 2007/04/23

[#11025] gsub with backslash characters in replacement string — "Adam Bozanich" <adam.boz@...>

Hello, spotted this one the other day:

10 messages 2007/04/26

Oniguruma/StringScanner performance issue

From: murphy <murphy@...>
Date: 2007-04-06 15:06:27 UTC
List: ruby-core #10883
The new Regexp engine still has an odd behavior which I think is a bug.
The following code tests four Regexps against the same long String:

  require "benchmark"
  require "strscan"

  text = "test " * 100_000
  regexps = [
    /\w+\s/,
    /\w+\s?/,
    /\w+\s*/,
    /\w+\s+/,
  ]

  Benchmark.bm(20) do |bm|
    text = StringScanner.new text
    for r in regexps
      bm.report r.source do
        text.scan(r) || text.getch until text.eos?
      end
      text.reset
    end
  end

The results on Mac OS X, Intel MacBook, are:

RUBY_VERSION  # => "1.8.5"
# >>                 user     system      total        real
# >> \w+\s       0.120000   0.000000   0.120000 (  0.117398)
# >> \w+\s?      0.120000   0.000000   0.120000 (  0.119532)
# >> \w+\s*      0.130000   0.000000   0.130000 (  0.128141)
# >> \w+\s+      0.120000   0.000000   0.120000 (  0.126463)

RUBY_VERSION  # => "1.9.0"
# >>                 user     system      total        real
# >> \w+\s       0.100000   0.000000   0.100000 (  0.097058)
# >> \w+\s?      0.610000   0.950000   1.560000 (  1.557211) (!)
# >> \w+\s*      0.620000   0.940000   1.560000 (  1.561926) (!)
# >> \w+\s+      0.610000   0.940000   1.550000 (  1.557454) (!)

As you can see, the scan with the Regexps that have two quantifiers take
much longer than they should.

The problem vanishes if you deactivate Oniguruma's
USE_COMBINATION_EXPLOSION_CHECK flag (patch) in regint.h (see attachment):

+/* #define USE_COMBINATION_EXPLOSION_CHECK        /* (X*)* */

RUBY_VERSION  # => "1.9.0"
# >>                 user     system      total        real
# >> \w+\s       0.090000   0.000000   0.090000 (  0.092095)
# >> \w+\s?      0.090000   0.000000   0.090000 (  0.092578)
# >> \w+\s*      0.110000   0.000000   0.110000 (  0.100903)
# >> \w+\s+      0.090000   0.000000   0.090000 (  0.096832)

String#scan doesn't show this behavior, only StringScanner seems to be
affected. I'm not sure where the real problem is, so I'm contacting the
ruby core list instead of Mr. Kosako.

The issue slows down my syntax highlighting library significantly, so it
can't profit from YARV speedups currently. So I hope we can fix this
before 1.9.1 comes out.

Thanks!
[murphy]

Attachments (1)

Index: regint.h
===================================================================
--- regint.h	(revision 12155)
+++ regint.h	(working copy)
@@ -100,7 +100,7 @@
 #include "ruby.h"
 #include "rubysig.h"      /* for DEFER_INTS, ENABLE_INTS */
 
-#define USE_COMBINATION_EXPLOSION_CHECK        /* (X*)* */
+/* #define USE_COMBINATION_EXPLOSION_CHECK        /* (X*)* */
 #define USE_MULTI_THREAD_SYSTEM
 
 #define THREAD_ATOMIC_START          DEFER_INTS

In This Thread

Prev Next