bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#55729: 27.1; Emacs 28.1 `string-match' is five times slower than Ema


From: Eli Zaretskii
Subject: bug#55729: 27.1; Emacs 28.1 `string-match' is five times slower than Emacs 27.1
Date: Tue, 31 May 2022 05:25:55 +0300

> Cc: 55729@debbugs.gnu.org
> Date: Tue, 31 May 2022 09:04:13 +0800
> From:  Po Lu via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> 
> Chen Bin <chenbin.sh@gmail.com> writes:
> 
> > Run below code in both Emacs 28.1 and Emacs 27.1
> >
> > ;; Run "base64 /dev/urandom | head -c 3000000000 > 3g.txt" to create 3g.txt
> > ;; Then run below code in Emacs,
> > (setq content
> >       (with-temp-buffer
> >         (let ((coding-system-for-read 'utf-8-unix))
> >           (insert-file-contents "3g.txt"))
> >         (buffer-string)))
> >
> > (message "content length=%s" (length content))
> > (let* ((gc-cons-threshold most-positive-fixnum))
> >   (message "%s vs %s"
> >            (benchmark-run-compiled 1
> >              (string-match "aaaaa" content))
> >            (benchmark-run-compiled 1
> >              (string-match "bbbbb" content))))
> >
> > Using same machine, same emacs setup, 28 is alwasy much slower than 27.
> >
> > Emacs 28 enables native compilation. But string-match is C API, so I'm not
> > sure native compilation matters.
> 
> Did you disable compiler optimizations when building Emacs?

Yes.  Here's the response (sent only to myself):

> From: Chen Bin <chenbin.sh@gmail.com>
> Date: Tue, 31 May 2022 04:53:55 +1000
> 
> Thanks for the heads up.
> 
> I double checked my build script and found I forgot to setup `-O2'
> CFLAG. Sorry to bother you guys with such my mistake. 
> 
> It's all good now.

So I'm closing this bug.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]