summaryrefslogtreecommitdiff
path: root/src/blocks.c
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2014-11-13 11:17:08 -0800
committerJohn MacFarlane <fiddlosopher@gmail.com>2014-11-13 11:17:08 -0800
commit5a8f1acf888c60463e7b418d55c1a5d26b3799f1 (patch)
tree21286ad596267444ed7eca2f036bc1cb295c44d9 /src/blocks.c
parent5cbede7a725b8b72779a5a4bd38d49a2d01fc022 (diff)
Moved the timing macros to get finer-grained information.
Diffstat (limited to 'src/blocks.c')
-rw-r--r--src/blocks.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/blocks.c b/src/blocks.c
index 615346d..a74d97e 100644
--- a/src/blocks.c
+++ b/src/blocks.c
@@ -9,6 +9,7 @@
#include "scanners.h"
#include "inlines.h"
#include "html/houdini.h"
+#include "bench.h"
#define peek_at(i, n) (i)->data[n]
@@ -378,6 +379,7 @@ static int lists_match(struct ListData *list_data, struct ListData *item_data)
static node_block *finalize_document(node_block *document, int linenum)
{
+ start_timer();
while (document != document->top) {
finalize(document, linenum);
document = document->parent;
@@ -385,6 +387,7 @@ static node_block *finalize_document(node_block *document, int linenum)
finalize(document, linenum);
process_inlines(document, document->as.document.refmap);
+ end_timer("finalize_document");
return document;
}
@@ -396,12 +399,14 @@ extern node_block *cmark_parse_file(FILE *f)
int linenum = 1;
node_block *document = make_document();
+ start_timer();
while (fgets((char *)buffer, sizeof(buffer), f)) {
utf8proc_detab(&line, buffer, strlen((char *)buffer));
incorporate_line(&line, linenum, &document);
strbuf_clear(&line);
linenum++;
}
+ end_timer("incorporate_line(s)");
strbuf_free(&line);
return finalize_document(document, linenum);