all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#59919: 28.1.50; "kill-matching-lines" takes forever
@ 2022-12-09  8:48 a.soroa
  2022-12-09  9:23 ` Gregory Heytings
  0 siblings, 1 reply; 4+ messages in thread
From: a.soroa @ 2022-12-09  8:48 UTC (permalink / raw)
  To: 59919

[-- Attachment #1: Log file --]
[-- Type: application/octet-stream, Size: 46084 bytes --]

[-- Attachment #2: Type: text/plain, Size: 4927 bytes --]


The kill-matching-lines function takes far too long. Trying to kill
lines matching the "ssh" regexp in the attached file takes minutes to
complete. The actual file I'm working on is much bigger, and emacs just
hangs. Reciple to reproduce:

$ bunzip2 log.txt.bz2
$ emacs -Q log.txt
M-x kill-matching-lines
Kill lines containing match for regexp: ssh


In GNU Emacs 28.1.50 (build 3, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo version 1.16.0)
 of 2022-09-06 built on u018594
Repository revision: dd3863d8bcc77c43363bbd041da1c1eb37a3ee32
Repository branch: HEAD
Windowing system distributor 'The X.Org Foundation', version 11.0.12201001
System Description: Ubuntu 22.04.1 LTS

Configured using:
 'configure --with-native-compilation'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
LCMS2 LIBOTF LIBSELINUX LIBXML2 M17N_FLT MODULES NATIVE_COMP NOTIFY
INOTIFY PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS
X11 XDBE XIM XPM GTK3 ZLIB

Important settings:
  value of $LC_MONETARY: en_GB.UTF-8
  value of $LC_NUMERIC: en_GB.UTF-8
  value of $LC_TIME: en_GB.UTF-8
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: Text

Minor modes in effect:
  windmove-mode: t
  which-key-mode: t
  global-company-mode: t
  company-mode: t
  recentf-mode: t
  marginalia-mode: t
  savehist-mode: t
  vertico-mode: t
  shell-dirtrack-mode: t
  save-place-mode: t
  override-global-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t

Load-path shadows:
/home/ccpsoeta/.emacs.d/elpa/transient-0.3.7/transient hides /usr/local/share/emacs/28.1.50/lisp/transient

Features:
(shadow sort mail-extr windmove emacsbug message rmc puny rfc822 mml
mml-sec gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047
rfc2045 ietf-drums mm-util mail-prsvr mail-utils dired-aux
modus-vivendi-theme modus-themes mule-util tramp-cmds cursor-sensor
ispell pcmpl-args pcmpl-gnu pcmpl-linux pcmpl-unix wgrep grep which-key
flymake-proc flymake compile text-property-search thingatpt
company-oddmuse company-keywords company-etags etags fileloop generator
xref project company-gtags company-dabbrev-code company-dabbrev
company-files company-capf company-cmake company-xcode company-clang
company-semantic company-eclim company-template company-bbdb company
pcase recentf tree-widget wid-edit marginalia savehist vertico python
tramp-sh tramp tramp-loaddefs trampver tramp-integration files-x
tramp-compat shell pcomplete parse-time iso8601 time-date ls-lisp
format-spec comint ring ansi-color dired-x dired dired-loaddefs printing
ps-print ps-print-loaddefs ps-def lpr epa derived epg rfc6068 epg-config
saveplace use-package use-package-ensure use-package-delight
use-package-diminish use-package-bind-key bind-key easy-mmode
use-package-core edmacro kmacro comp comp-cstr warnings rx cl-extra
help-mode finder-inf tex-site info package browse-url url url-proxy
url-privacy url-expand url-methods url-history url-cookie url-domsuf
url-util mailcap url-handlers url-parse auth-source cl-seq eieio
eieio-core cl-macs eieio-loaddefs password-cache json subr-x map
url-vars seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib
iso-transl tooltip eldoc paren electric uniquify ediff-hook vc-hooks
lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd
tool-bar dnd fontset image regexp-opt fringe tabulated-list replace
newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar
rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock
font-lock syntax font-core term/tty-colors frame minibuffer cl-generic
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite emoji-zwj charscript
charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray
cl-preloaded nadvice button loaddefs faces cus-face macroexp files
window text-properties overlay sha1 md5 base64 format env code-pages
mule custom widget hashtable-print-readable backquote threads dbusbind
inotify lcms2 dynamic-setting system-font-setting font-render-setting
cairo move-toolbar gtk x-toolkit x multi-tty make-network-process
native-compile emacs)

Memory information:
((conses 16 310995 38845)
 (symbols 48 20539 0)
 (strings 32 73046 3183)
 (string-bytes 1 2942521)
 (vectors 16 32711)
 (vector-slots 8 594996 26057)
 (floats 8 498 121)
 (intervals 56 532 13)
 (buffers 992 13))

^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#59919: 28.1.50; "kill-matching-lines" takes forever
  2022-12-09  8:48 bug#59919: 28.1.50; "kill-matching-lines" takes forever a.soroa
@ 2022-12-09  9:23 ` Gregory Heytings
  2022-12-09 15:18   ` aitor
  0 siblings, 1 reply; 4+ messages in thread
From: Gregory Heytings @ 2022-12-09  9:23 UTC (permalink / raw)
  To: a.soroa; +Cc: 59919


>
> The kill-matching-lines function takes far too long. Trying to kill 
> lines matching the "ssh" regexp in the attached file takes minutes to 
> complete. The actual file I'm working on is much bigger, and emacs just 
> hangs. Reciple to reproduce:
>
> $ bunzip2 log.txt.bz2
> $ emacs -Q log.txt
> M-x kill-matching-lines
> Kill lines containing match for regexp: ssh
>

Are you sure you actually want to _kill_ ("cut" in modern parlance) those 
lines?  In the file you attach, all 10000 lines match "ssh", so it means 
that Emacs "cuts" each of those lines one by one, which of course takes 
(quite) some time.  If you use a regexp that does not match all lines, say 
"109.106.244.80", the effect is almost instantaneous.

Note that there is also a command "flush-lines", is that not the one you 
actually need here?






^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#59919: 28.1.50; "kill-matching-lines" takes forever
  2022-12-09  9:23 ` Gregory Heytings
@ 2022-12-09 15:18   ` aitor
  2022-12-09 15:23     ` Gregory Heytings
  0 siblings, 1 reply; 4+ messages in thread
From: aitor @ 2022-12-09 15:18 UTC (permalink / raw)
  To: Gregory Heytings; +Cc: 59919

On Fri, Dec 09, 2022 at 09:23:38AM +0000, Gregory Heytings wrote:
>
> Are you sure you actually want to _kill_ ("cut" in modern parlance) those
> lines?  In the file you attach, all 10000 lines match "ssh", so it means
> that Emacs "cuts" each of those lines one by one, which of course takes
> (quite) some time.  If you use a regexp that does not match all lines, say
> "109.106.244.80", the effect is almost instantaneous.
> 
> Note that there is also a command "flush-lines", is that not the one you
> actually need here?

You are right, I actually needed the flush-lines command instead of
kill-matching-lines (which is almost instantaneous).

Sorry for the noise, you can close the report.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#59919: 28.1.50; "kill-matching-lines" takes forever
  2022-12-09 15:18   ` aitor
@ 2022-12-09 15:23     ` Gregory Heytings
  0 siblings, 0 replies; 4+ messages in thread
From: Gregory Heytings @ 2022-12-09 15:23 UTC (permalink / raw)
  To: aitor; +Cc: 59919-done


>> Are you sure you actually want to _kill_ ("cut" in modern parlance) 
>> those lines?  In the file you attach, all 10000 lines match "ssh", so 
>> it means that Emacs "cuts" each of those lines one by one, which of 
>> course takes (quite) some time.  If you use a regexp that does not 
>> match all lines, say "109.106.244.80", the effect is almost 
>> instantaneous.
>>
>> Note that there is also a command "flush-lines", is that not the one 
>> you actually need here?
>
> You are right, I actually needed the flush-lines command instead of 
> kill-matching-lines (which is almost instantaneous).
>
> Sorry for the noise, you can close the report.
>

No worries!

Closing.






^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-12-09 15:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-09  8:48 bug#59919: 28.1.50; "kill-matching-lines" takes forever a.soroa
2022-12-09  9:23 ` Gregory Heytings
2022-12-09 15:18   ` aitor
2022-12-09 15:23     ` Gregory Heytings

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.