mirror of https://github.com/djcb/mu.git
lib/mu-msg: benchmark message creation
This commit is contained in:
parent
5ca0b6e148
commit
5922cd9fa2
13
lib/mu-msg.c
13
lib/mu-msg.c
|
@ -74,11 +74,14 @@ MuMsg*
|
|||
mu_msg_new_from_file (const char *path, const char *mdir,
|
||||
GError **err)
|
||||
{
|
||||
MuMsg *self;
|
||||
MuMsg *self;
|
||||
MuMsgFile *msgfile;
|
||||
gint64 start;
|
||||
|
||||
g_return_val_if_fail (path, NULL);
|
||||
|
||||
start = g_get_monotonic_time();
|
||||
|
||||
if (G_UNLIKELY(!_gmime_initialized)) {
|
||||
gmime_init ();
|
||||
atexit (gmime_uninit);
|
||||
|
@ -91,17 +94,23 @@ mu_msg_new_from_file (const char *path, const char *mdir,
|
|||
self = msg_new ();
|
||||
self->_file = msgfile;
|
||||
|
||||
g_debug ("created msg from file in %" G_GINT64_FORMAT "us",
|
||||
g_get_monotonic_time() - start);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
MuMsg*
|
||||
mu_msg_new_from_doc (XapianDocument *doc, GError **err)
|
||||
{
|
||||
MuMsg *self;
|
||||
MuMsg *self;
|
||||
MuMsgDoc *msgdoc;
|
||||
gint64 start;
|
||||
|
||||
g_return_val_if_fail (doc, NULL);
|
||||
|
||||
start = g_get_monotonic_time();
|
||||
|
||||
if (G_UNLIKELY(!_gmime_initialized)) {
|
||||
gmime_init ();
|
||||
atexit (gmime_uninit);
|
||||
|
|
Loading…
Reference in New Issue