Giter Site home page Giter Site logo

Comments (5)

gskinner avatar gskinner commented on August 19, 2024

That pattern results in an exponential growth for the search cost. That is, every additional character in the Text costs exponentially more than the one before it to run the search.

Safari and Firefox limit the maximum search time, but Chrome and IE do not. For me, about 90 characters is where it becomes noticeably slow, and by the time you hit 100 it's crashing. This only seems to happen if there are spaces in the string.

Unfortunately, regex execution is a black box, so we can't really handle this case. Feel free to report it to the Chrome and IE teams, and hopefully they will address it in future builds.

It might be possible to push it to a worker, and then terminate it if it takes too long. I'm not sure whether termination would work with a runaway internal process. Worth looking into, particularly if we add support for asynchronous results in preparation for supporting other flavours.

I'll leave this open for now.

from regexr.

 avatar commented on August 19, 2024

Thanks for the quick and detailed reply.

from regexr.

gskinner avatar gskinner commented on August 19, 2024

As an update to this, we just merged in a fix that uses Workers. We're still tweaking the related UI, but it should push live in the next week or so.

from regexr.

 avatar commented on August 19, 2024

That was quick thanks for the update. Will try it out soon.

from regexr.

gskinner avatar gskinner commented on August 19, 2024

This update just went live. Thanks again for the report.

from regexr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.