From 4881e1240ccf30aa6cadeba811f7faf36e2189c5 Mon Sep 17 00:00:00 2001 From: Colin Rofls Date: Thu, 25 Jul 2024 11:16:02 -0400 Subject: [PATCH] [ttx_diff] replace difflib with cdifflib difflib is not very efficient, and this has a significant impact on runtime; for `NotoSansMono` I go from 18m of wall time to 13m16s. --- resources/scripts/requirements.txt | 1 + resources/scripts/ttx_diff.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/scripts/requirements.txt b/resources/scripts/requirements.txt index caa419c2..b23f88ac 100644 --- a/resources/scripts/requirements.txt +++ b/resources/scripts/requirements.txt @@ -6,3 +6,4 @@ fontmake[repacker]==3.8.1 # our scripts import it directly, so we list it among the top-level requirements. fonttools lxml +cdifflib diff --git a/resources/scripts/ttx_diff.py b/resources/scripts/ttx_diff.py index 73ac2993..0c5db2fc 100755 --- a/resources/scripts/ttx_diff.py +++ b/resources/scripts/ttx_diff.py @@ -42,7 +42,7 @@ import shutil import subprocess import sys -from difflib import SequenceMatcher +from cdifflib import CSequenceMatcher as SequenceMatcher from typing import MutableSequence