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)
This commit is contained in:
@ -36,19 +36,16 @@ class Server {
|
||||
public:
|
||||
enum struct OutputFlags {
|
||||
None = 0,
|
||||
SplitList = 1 << 0,
|
||||
/**< insert newlines between list items */
|
||||
Flush = 1 << 1,
|
||||
/**< flush output buffer after */
|
||||
Flush = 1 << 0, /**< flush output buffer after */
|
||||
};
|
||||
|
||||
/**
|
||||
* Prototype for output function
|
||||
*
|
||||
* @param sexp an s-expression
|
||||
* @param str a string
|
||||
* @param flags flags that influence the behavior
|
||||
*/
|
||||
using Output = std::function<void(const Sexp& sexp, OutputFlags flags)>;
|
||||
using Output = std::function<void(const std::string& str, OutputFlags flags)>;
|
||||
|
||||
struct Options {
|
||||
bool allow_temp_file; /**< temp file optimization allowed? */
|
||||
|
||||
Reference in New Issue
Block a user