From e98091d56afdf1cf6c9a017fa0bd35dd0b8968f0 Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Wed, 20 Jul 2016 20:59:21 +0100 Subject: Move hash calculation outside locked region. Try to reduce contention on the glyphcache lock. --- source/fitz/draw-glyph.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/fitz') diff --git a/source/fitz/draw-glyph.c b/source/fitz/draw-glyph.c index 014cc13a..dbaace9e 100644 --- a/source/fitz/draw-glyph.c +++ b/source/fitz/draw-glyph.c @@ -286,8 +286,8 @@ fz_render_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix *ctm, fz_colo key.d = subpix_ctm.d * 65536; key.aa = fz_text_aa_level(ctx); - fz_lock(ctx, FZ_LOCK_GLYPHCACHE); hash = do_hash((unsigned char *)&key, sizeof(key)) % GLYPH_HASH_LEN; + fz_lock(ctx, FZ_LOCK_GLYPHCACHE); entry = cache->entry[hash]; while (entry) { -- cgit v1.2.3