From b1f8dd75d684b3dd00f147a63ef687a6b566fc7f Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Wed, 10 Jul 2019 18:47:32 +0200 Subject: cell: we only need 4 bytes for the longest utf8 sequence We don't *have* to NULL-terminate the utf8 string. So don't. This makes the cell glyph 4 bytes exactly, which is better for alignment and cache usage. --- render.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'render.c') diff --git a/render.c b/render.c index 65e2ab96..894bc939 100644 --- a/render.c +++ b/render.c @@ -101,7 +101,7 @@ render_cell(struct terminal *term, struct buffer *buf, const struct cell *cell, cairo_status_t status = cairo_scaled_font_text_to_glyphs( attrs_to_font(term, &cell->attrs), x, y + term->fextents.ascent, - cell->c, strlen(cell->c), &gseq.g, &new_glyphs, + cell->c, strnlen(cell->c, 4), &gseq.g, &new_glyphs, NULL, NULL, NULL); if (status != CAIRO_STATUS_SUCCESS) -- cgit v1.3 From 4ffd93ca4cb8abc54aacb3e554d0b91225d9376d Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Wed, 10 Jul 2019 18:49:34 +0200 Subject: render: reduce scrollback line count More than 1000 lines and we start exhibiting bad cache behavior --- render.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'render.c') diff --git a/render.c b/render.c index 894bc939..a97e53cb 100644 --- a/render.c +++ b/render.c @@ -379,7 +379,7 @@ render_resize(struct terminal *term, int width, int height) term->width = width; term->height = height; - const int scrollback_lines = 10000; + const int scrollback_lines = 1000; const int old_cols = term->cols; const int old_rows = term->rows; -- cgit v1.3