Skip to content

80x slowness on v1.13.0 #2

@chuan29812

Description

@chuan29812

Hey there, we just upgrade from 1.8 to 1.13, and a feature of ours has experienced siginificant slowdown. And we believe it was this commit

And I also believe the root cause is the Ignorable is mistakenly configured as a Array as opposed to a Hash. I reduced it to a Hash locally, and the benchmark went down to 3 seconds

To reproduce this, you can simply do it in irb, this takes about 250seconds on my machine on 1.13.0 and only 3 seconds on 1.8.0

require 'benchmark'
require 'unicode/confusable'

test_str = "some long string" * 1000
Benchmark.bm do |x|
  x.report("skeleton") { 1000.times { Unicode::Confusable.skeleton(test_str) } }
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions