Commit Graph

6802 Commits

Author SHA1 Message Date
Dirk-Jan C. Binnema 253b44043b indexer: disable lazy check for "full" scan
Lazy would actually do _more_ work a full scan.
2023-08-06 16:19:43 +03:00
Dirk-Jan C. Binnema 4ecf386cda utils-file: don't use regexp in join_paths
It's slow.
2023-08-06 16:19:43 +03:00
Dirk-Jan C. Binnema fa2ceec4ae man: add performance notes to find/index/server manpages 2023-08-06 16:19:43 +03:00
Dirk-Jan C. Binnema 01a516f0d3 server: tweak sexp generation 2023-08-06 16:19:43 +03:00
Dirk-Jan C. Binnema 4945e699c8 lib/mu: use fmt-based time/date formatting
For a small speedup
2023-08-06 16:19:43 +03:00
Dirk-Jan C. Binnema 27c07280b1 utils: replace time_to_string with fmt-based formatting
It's faster; make "mu find" ~5-10% faster, and removes some code we no
longer need.
2023-08-06 16:19:43 +03:00
Dirk-Jan C. Binnema bdbf47c80f Makefile: improve benchmark targets 2023-08-06 16:19:43 +03:00
Dirk-Jan C. Binnema 6dfb2aae7b server: don't use structured-bindings / lambda for contacts_handler
Older clang doesn't like that.
2023-08-04 22:00:51 +03:00
Dirk-Jan C. Binnema 75c37a506b server: don't use structured-bindings / lambda
Older clang doesn't like that.
2023-08-04 21:44:58 +03:00
Dirk-Jan C. Binnema d47c92c287 docs: update README/NEWS. 2023-08-04 21:39:01 +03:00
Dirk-Jan C. Binnema f89e4c26d7 server: attempt to appease clang (pair/tuple)
https://stackoverflow.com/questions/46114214/lambda-implicit-capture-fails-with-variable-declared-from-structured-binding
2023-08-04 21:21:49 +03:00
Dirk-Jan C. Binnema 589327afd7 build: bump version to 1.11.13, update NEWS.org 2023-08-04 00:09:02 +03:00
Dirk-Jan C. Binnema 051fdb4ccf lib/config: set default batch-size to 50000
The default was 250000 but that led to problems on some systems with
limited memory, esp. since mu's indexing does quite a bit more than in
the olden days (e.g. html mail).

Fixes #2529.
2023-08-04 00:09:02 +03:00
Dirk-Jan C. Binnema 25151aad00 mu-query: small optimization tweaks 2023-08-04 00:09:02 +03:00
Dirk-Jan C. Binnema aea95b5be0 mu-server: use strings, not sexps object (optimization)
When passing messages to mu, often we got a (parsed from string)
message-sexp from the message document; then appended some more
properties ("build_message_sexp").

Instead, we can do it in terms of the strings; this is _a little_
inelegant, but also much faster; compare:

(base)
[mu4e] Found 500 matching messages; 0 hidden; search: 1298.0 ms (2.60 ms/msg); render: 642.1 ms (1.28 ms/msg)

(with temp-file optimization (earlier commit)
[mu4e] Found 500 matching messages; 0 hidden; search: 1152.7 ms (2.31 ms/msg); render: 270.1 ms (0.54 ms/msg)

(with temp file optimize _and_ the string opt (this commit)
[mu4e] Found 500 matching messages; 0 hidden; search: 266.0 ms (0.53 ms/msg); render: 199.7 ms (0.40 ms/msg)
2023-08-04 00:09:02 +03:00
Dirk-Jan C. Binnema 1018f0f0a1 mu-document: Make sexp() lazy (optimization)
This makes queries where we don't need the sexp much faster; e.g.

before:
   mu find "a" --include-related  47,51s user 2,68s system 99% cpu 50,651 total
after:
  mu find "a" --include-related  7,12s user 1,97s system 87% cpu 10,363 total
2023-08-04 00:09:02 +03:00
Dirk-Jan C. Binnema 7c85b61944 mu4e-server: enable mu4e-mu-allow-temp-file optimization
Add a new configuration variable mu4e-mu-allow-temp-file, t by default,
which triggers the same optimization in the mu server.

It improves message rendering speed:

I.e. without:
  [mu4e] Found 500 matching messages; 0 hidden; search: 1298.0 ms (2.60 ms/msg); render: 642.1 ms (1.28 ms/msg)
with:
  [mu4e] Found 500 matching messages; 0 hidden; search: 1152.7 ms (2.31 ms/msg); render: 270.1 ms (0.54 ms/msg)

As a useful side-effect, this also:
Fixes #1802.
2023-08-04 00:09:02 +03:00
Dirk-Jan C. Binnema 924bb2145e mu-server: implement temp-file optimization
It can be faster to feed big mu -> mu4e data, such as contacts are
message headers through a temp-file instead directly though stdout;
implement this, and add the server parameter --allow-temp-file.

Implement this the "contacts" and "find" commands.
2023-08-04 00:09:02 +03:00
Dirk-Jan C. Binnema 0ace413f80 mu4e-headers: don't auto-update header with message open
Avoid removing a message that's potentially being looked at.

Fixes #1055
Fixes #1981
2023-08-04 00:08:30 +03:00
Dirk-Jan C. Binnema a71b4f5e8d options: expand option file paths
Fixes #2528
2023-08-03 22:47:27 +03:00
Dirk-Jan C. Binnema ade62fc67c options: implement ExpandPath transformer
For expanding shell options (with expand_path / wordexp)

Note that e.g. in zsh: --maildir=~/Maildir is handled (program receives
--maildir=/home/user/Maildir) but e.g. bash does not do that, and the
program receives the literal '~/Maildir'

We expanded this in mu earlier, so let's do that again.
2023-08-03 22:47:27 +03:00
Dirk-Jan C. Binnema 111e48efa3 utils: add expand_path (wordexp wrapper)
For expanding command-line options for shells that don't do that by themselves.
2023-08-03 22:47:27 +03:00
Dirk-Jan C. Binnema b91272aca2 mu-mkdir manpage: small fix 2023-08-03 19:49:39 +03:00
Dirk-Jan C. Binnema 890fc46da9 mu4e-update: save last update results in *mu4e-last-update*
This can be useful for diagnosis.

Fixes #2455
2023-08-03 19:48:49 +03:00
Dirk-Jan C. Binnema 2f98dacade mu4e/mu4e.texi: fix external links in html
Fixes #2182.
2023-08-03 19:48:49 +03:00
Dirk-Jan C. Binnema 5409c2cd87 mu-view: attempt to avoid locale diffs in test
A bit ugly attempt make tests work in CI
2023-07-30 00:51:12 +03:00
Dirk-Jan C. Binnema 33fd79a9f0 mu-regex: add multiline test 2023-07-30 00:50:45 +03:00
Dirk-Jan C. Binnema 3a38d6366a mu-view: test locale to C for tests 2023-07-29 17:25:07 +03:00
Dirk-Jan C. Binnema 3ada6af63a mu-view: check for timezone availability in tests 2023-07-29 16:39:44 +03:00
Dirk-Jan C. Binnema 766d1849ff test-utils: add TempTz, RAII temporary timezone 2023-07-29 16:39:08 +03:00
Dirk-Jan C. Binnema 1f0342a91f mu-view: add unit-test 2023-07-28 19:43:46 +03:00
Dirk-Jan C. Binnema 2950a3f103 NEWS.org: improve ignored-address example 2023-07-28 19:42:53 +03:00
Dirk-Jan C. Binnema c9b64a0114 mu4e-compose: jit-start mu4e in mu4e-compose
Just in case it wasn't running yet.

Fixes #2526
2023-07-28 19:35:39 +03:00
Dirk-Jan C. Binnema dc29dc8395 html-to-text: add missing include <array> 2023-07-26 23:30:54 +03:00
Dirk-Jan C. Binnema c06e765d13 html-to-text: be explicit with array type
clang in CI fails to deduce it, so let's help it a bit.
2023-07-26 23:24:29 +03:00
Dirk-Jan C. Binnema 275859a5b3 build: bump version to 1.11.12 2023-07-26 19:12:27 +03:00
Dirk-Jan C. Binnema 455119f695 Merge branch 'wip/djcb/html-to-text' 2023-07-26 19:11:41 +03:00
Dirk-Jan C. Binnema 21a760d2c7 NEWS.org: update 2023-07-26 19:10:36 +03:00
Dirk-Jan C. Binnema 30b0209f8d mu-info: add 'topic mu' information; improve manpage
Show some more runtime information in the 'mu' topic, and make that the
default. Update manpage.
2023-07-26 19:09:18 +03:00
Dirk-Jan C. Binnema 3aecaca9b9 build: bump version to 1.11.11 2023-07-26 19:06:04 +03:00
Dirk-Jan C. Binnema da290c21a9 benchmark: improve setup
Add some useful make targets, and separate (optimized) build.
2023-07-25 23:56:19 +03:00
Dirk-Jan C. Binnema 4c0b7db3d8 store: add 'add_document' optimization, use it
*Usually* we need Xapian's replace_document() API, but when we know a
document (message) is completely new, we can use the faster
add_document(). That is the case with the initial (re)indexing, when
start with an empty database.

Also a few smaller cleanups.
2023-07-25 23:56:19 +03:00
Dirk-Jan C. Binnema 4d8ba5f579 index/scanner: implement i-node sorting
On rotational devices (HDD) processing direntries is much faster when
doing so sorted by i-node for the dir-entries. This is an old
optimization (perhaps mu <= 1.6 or so?) that was implemented yet after
indexing changed, likely because my systems use SDDs instead!

But, let's restore that optimization; the sorting is fast enough that we
don't care for SDDs; on HDD it should be quite a bit faster.
2023-07-25 22:39:12 +03:00
Dirk-Jan C. Binnema b795242d5a message: use html-to-text scraper for html parts
We were dumping the HTML-parts as-is in the Xapian indexer; however,
it's better to remove the html decoration first, and just pass the text.

We use the new built-in html->text scraper for that.
2023-07-25 21:26:36 +03:00
Dirk-Jan C. Binnema 56b8fad89e utils: implement html-to-text
Implement a crude html-to-text scraper function, to extract plain text
from html messages, so we can use it for indexing.
2023-07-25 21:26:36 +03:00
Dirk-Jan C. Binnema 23ba61a650 mu-find: internal cleanups / modernization
use fmt and Result-based APIs.
2023-07-25 21:26:01 +03:00
Dirk-Jan C. Binnema 11c807f955 utils/readline: use fmt-based apis 2023-07-25 21:26:01 +03:00
Dirk-Jan C. Binnema 9580d11fef utils/result: add std::move version of Err
Avoid a copy in some situations
2023-07-25 21:26:01 +03:00
Dirk-Jan C. Binnema dcf2298680 mu: use fmt-based apis in mu index/server and options
iostream is so 1998.
2023-07-25 21:11:56 +03:00
Dirk-Jan C. Binnema 85a2490300 mu-init: improve user output 2023-07-25 11:11:53 +03:00