mirror of
https://github.com/odin-lang/Odin.git
synced 2026-06-13 13:53:43 +00:00
Begin to see where the performance issues are in the parser
This commit is contained in:
@@ -2198,7 +2198,7 @@ gb_internal void show_timings(Checker *c, Timings *t) {
|
||||
}
|
||||
{
|
||||
f64 time = total_tokenizing_time;
|
||||
gb_printf_err("Tokenization Only\n");
|
||||
gb_printf_err("Tokenization Only per thread\n");
|
||||
gb_printf_err("LOC/s - %.3f\n", cast(f64)lines/time);
|
||||
gb_printf_err("us/LOC - %.3f\n", 1.0e6*time/cast(f64)lines);
|
||||
gb_printf_err("Tokens/s - %.3f\n", cast(f64)tokens/time);
|
||||
@@ -2211,7 +2211,7 @@ gb_internal void show_timings(Checker *c, Timings *t) {
|
||||
}
|
||||
{
|
||||
f64 time = total_parsing_time;
|
||||
gb_printf_err("Parsing Only\n");
|
||||
gb_printf_err("Parsing Only per thread\n");
|
||||
gb_printf_err("LOC/s - %.3f\n", cast(f64)lines/time);
|
||||
gb_printf_err("us/LOC - %.3f\n", 1.0e6*time/cast(f64)lines);
|
||||
gb_printf_err("Tokens/s - %.3f\n", cast(f64)tokens/time);
|
||||
@@ -2233,7 +2233,7 @@ gb_internal void show_timings(Checker *c, Timings *t) {
|
||||
GB_ASSERT(ts.label == "parse files");
|
||||
|
||||
f64 parse_time = time_stamp_as_s(ts, t->freq);
|
||||
gb_printf_err("Parse pass\n");
|
||||
gb_printf_err("Parse pass (all threads)\n");
|
||||
gb_printf_err("LOC/s - %.3f\n", cast(f64)lines/parse_time);
|
||||
gb_printf_err("us/LOC - %.3f\n", 1.0e6*parse_time/cast(f64)lines);
|
||||
gb_printf_err("Tokens/s - %.3f\n", cast(f64)tokens/parse_time);
|
||||
|
||||
@@ -1463,7 +1463,7 @@ gb_internal bool next_token0(AstFile *f) {
|
||||
}
|
||||
|
||||
|
||||
gb_internal Token consume_comment(AstFile *f, isize *end_line_) {
|
||||
gb_internal Token consume_comment_internal(AstFile *f, isize *end_line_) {
|
||||
Token tok = f->curr_token;
|
||||
GB_ASSERT(tok.kind == Token_Comment);
|
||||
isize end_line = tok.pos.line;
|
||||
@@ -1483,6 +1483,17 @@ gb_internal Token consume_comment(AstFile *f, isize *end_line_) {
|
||||
|
||||
|
||||
gb_internal CommentGroup *consume_comment_group(AstFile *f, isize n, isize *end_line_) {
|
||||
#if 0
|
||||
if (build_context.command_kind != Command_doc) {
|
||||
isize end_line = f->curr_token.pos.line;
|
||||
while (f->curr_token.kind == Token_Comment &&
|
||||
f->curr_token.pos.line <= end_line+n) {
|
||||
next_token0(f);
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
#endif
|
||||
|
||||
Array<Token> list = {};
|
||||
list.allocator = ast_allocator(f);
|
||||
isize end_line = f->curr_token.pos.line;
|
||||
@@ -1494,7 +1505,7 @@ gb_internal CommentGroup *consume_comment_group(AstFile *f, isize n, isize *end_
|
||||
}
|
||||
while (f->curr_token.kind == Token_Comment &&
|
||||
f->curr_token.pos.line <= end_line+n) {
|
||||
array_add(&list, consume_comment(f, &end_line));
|
||||
array_add(&list, consume_comment_internal(f, &end_line));
|
||||
}
|
||||
|
||||
if (end_line_) *end_line_ = end_line;
|
||||
|
||||
Reference in New Issue
Block a user