Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rust-lang/regex Loading
base: 1.4.3
Choose a base ref
...
head repository: rust-lang/regex Loading
compare: 1.4.5
Choose a head ref
  • 12 commits
  • 26 files changed
  • 4 contributors

Commits on Jan 12, 2021

  1. api: Replacer for more string types

    And do the same for the bytes oriented APIs.
    
    This results in some small quality of life improvements
    when using the Replacer trait with a string type that
    isn't &str.
    
    PR #728
    nooberfsh committed Jan 12, 2021
    Configuration menu
    Copy the full SHA
    2bab987 View commit details
    Browse the repository at this point in the history
  2. doc: use HTTPS in links

    PR #726
    atouchet committed Jan 12, 2021
    Configuration menu
    Copy the full SHA
    259863d View commit details
    Browse the repository at this point in the history

Commits on Jan 21, 2021

  1. doc: use 'text' instead of 'ignore' for regexes

    This makes rendering a bit nicer by disabling syntax
    highlighting and removing the "untested" warning.
    
    PR #741
    markusolt committed Jan 21, 2021
    Configuration menu
    Copy the full SHA
    bf7f8f1 View commit details
    Browse the repository at this point in the history

Commits on Mar 12, 2021

  1. deps: update quickcheck and rand

    The quickcheck update seems to have sussed out a bug in our DFA logic
    regarding the encoding of NFA state IDs. But the bug seems unlikely to
    occur in real code, so we massage the test data for now until the lazy
    DFA gets moved into regex-automata.
    BurntSushi committed Mar 12, 2021
    Configuration menu
    Copy the full SHA
    f858ff3 View commit details
    Browse the repository at this point in the history
  2. bench: reduce huge regex a bit

    It looks like it blows the default regex size limit at the moment.
    BurntSushi committed Mar 12, 2021
    Configuration menu
    Copy the full SHA
    691ec58 View commit details
    Browse the repository at this point in the history
  3. doc: refine use of the word 'unsafe'

    This removes extraneous commentary that uses the word 'unsafe'. This
    makes it easier to grep for usages of meaningful 'unsafe' in the code.
    BurntSushi committed Mar 12, 2021
    Configuration menu
    Copy the full SHA
    5107293 View commit details
    Browse the repository at this point in the history
  4. impl: drop thread_local dependency

    This commit removes the thread_local dependency (even as an optional
    dependency) and replaces it with a more purpose driven memory pool. The
    comments in src/pool.rs explain this in more detail, but the short story
    is that thread_local seems to be at the root of some memory leaks
    happening in certain usage scenarios.
    
    The great thing about thread_local though is how fast it is. Using a
    simple Mutex<Vec<T>> is easily at least twice as slow. We work around
    that a bit by coding a simplistic fast path for the "owner" of a pool.
    This does require one new use of `unsafe`, of which we extensively
    document.
    
    This now makes the 'perf-cache' feature a no-op. We of course retain it
    for compatibility purposes (and perhaps it will be used again in the
    future), but for now, we always use the same pool.
    
    As for benchmarks, it is likely that *some* cases will get a hair
    slower. But there shouldn't be any dramatic difference. A careful review
    of micro-benchmarks in addition to more holistic (albeit ad hoc)
    benchmarks via ripgrep seems to confirm this.
    
    Now that we have more explicit control over the memory pool, we also
    clean stuff up with repsect to RefUnwindSafe.
    
    Fixes #362, Fixes #576
    
    Ref BurntSushi/rure-go#3
    BurntSushi committed Mar 12, 2021
    Configuration menu
    Copy the full SHA
    e040c1b View commit details
    Browse the repository at this point in the history
  5. changelog: 1.4.4

    BurntSushi committed Mar 12, 2021
    Configuration menu
    Copy the full SHA
    967a090 View commit details
    Browse the repository at this point in the history
  6. regex-syntax-0.6.23

    BurntSushi committed Mar 12, 2021
    Configuration menu
    Copy the full SHA
    5a35701 View commit details
    Browse the repository at this point in the history
  7. 1.4.4

    BurntSushi committed Mar 12, 2021
    Configuration menu
    Copy the full SHA
    951b8b9 View commit details
    Browse the repository at this point in the history

Commits on Mar 14, 2021

  1. impl: substantially reduce regex stack size

    This commit fixes a fairly large regression in the stack size of a Regex
    introduced in regex 1.4.4. When I dropped thread_local and replaced it
    with Pool, it turned out that Pool inlined a T into its struct and a
    Regex in turn had Pool inlined into itself. It further turns out that
    the T=ProgramCache is itself quite large.
    
    We fix this by introducing an indirection in the inner regex type. That
    is, we use a Box<Pool> instead of a Pool. This shrinks the size of a
    Regex from 856 bytes to 16 bytes.
    
    Interestingly, prior to regex 1.4.4, a Regex was still quite substantial
    in size, coming in at around 552 bytes. So it looks like the 1.4.4
    release didn't dramatically increase it, but it increased it enough that
    folks started experiencing real problems: stack overflows.
    
    Since indirection can lead to worse locality and performance loss, I did
    run the benchmark suite. I couldn't see any measurable difference. This
    is generally what I would expect. This is an indirection at a fairly
    high level. There's lots of other indirection already, and this
    indirection isn't accessed in a hot path. (The regex cache itself is of
    course used in hot paths, but by the time we get there, we have already
    followed this particular pointer.)
    
    We also include a regression test that asserts a Regex (and company) are
    16 bytes in size. While this isn't an API guarantee, it at least means
    that increasing the size of Regex will be an intentional thing in the
    future and not an accidental leakage of implementation details.
    
    Fixes #750, Fixes #751
    
    Ref servo/servo#28269
    BurntSushi committed Mar 14, 2021
    Configuration menu
    Copy the full SHA
    78c7cef View commit details
    Browse the repository at this point in the history
  2. 1.4.5

    BurntSushi committed Mar 14, 2021
    Configuration menu
    Copy the full SHA
    ff283ba View commit details
    Browse the repository at this point in the history
Loading