mirror of https://github.com/djcb/mu.git
lib/mu-msg: benchmark message creation
This commit is contained in:
parent
5ca0b6e148
commit
5922cd9fa2
|
@ -76,9 +76,12 @@ mu_msg_new_from_file (const char *path, const char *mdir,
|
|||
{
|
||||
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,6 +94,9 @@ 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;
|
||||
}
|
||||
|
||||
|
@ -99,9 +105,12 @@ mu_msg_new_from_doc (XapianDocument *doc, GError **err)
|
|||
{
|
||||
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