From 525b4a26637369fc42ee368aa03e3ae69eb08ffb Mon Sep 17 00:00:00 2001 From: Christer Jensen Date: Thu, 31 Aug 2017 06:17:20 +0200 Subject: [PATCH] Improve performance by dividing up tasks The stream of inkscape commands have been divided across multiple instances of inkscape, one per core. This speeds up rendering by using more cpu cores, even for single svg rendering. To do this a simple java program was written which starts N instances of whatever arguments was passed to it and then reads one line at the time from standard input, the lines are then divided into N seperate streams which are then piped to the the difference instances of whatever program was passed as argument to SplitJob. --- src/SplitJob.class | Bin 0 -> 2401 bytes src/SplitJob.java | 54 ++++++++++++++++++++++++++++++++++++++++++++ src/render_icons.sh | 5 ++-- 3 files changed, 56 insertions(+), 3 deletions(-) create mode 100644 src/SplitJob.class create mode 100644 src/SplitJob.java diff --git a/src/SplitJob.class b/src/SplitJob.class new file mode 100644 index 0000000000000000000000000000000000000000..10c467d6727cc7fa6cde72fba3d713f1b54d0144 GIT binary patch literal 2401 zcma)8%Xbr182?R^$xX&7g|=xMEKnZB6fBhjRnzinDH1F#HVDRwGEJssAWh;c zimx<;5Yf<$9!a(f>=4+gLB*~BcB5DB`Xt#CzD%1t7DFlIC;Rx7WD;= z3s?dth>pNX=B&WqlSsL-v{)u@C(ON;^jsawrYvWFW^|KGQpW~tq^*t=CUm5cQLwC- zeKF!eJCiVTIhJ$>uQzX{Sd($YEzJ{XZ9o<$CnioXV*}TKrO=F@o2@;-5 z61p!W`I6n5?+O#SOUoBEWjLR9tO>TVzEaa|6=$rX;u78pv~kl}Fbjs;Du&8s)2@#5 zV5Q{zxxO+sJI_IlDp*}c#}&FwTsLecEt{~ihVoXArqia~mojoWlRiXra9{s$^pJwJ z6_NkN5i_agktsSY_E^Er@c%HYENZc9dQ@|cVKc|YwYzGR``MeMJcUGc5j^ghaXvfF zTcw17>gUI;lF!m7ZOdU@B0SO?jmpbI9ZThN$GIj_nVghN8kVy+V=o?^GdahcVE;{< zf?%lu40@1vkUPtaS#eiH(~dcAQdgWZQh9S|OkQ8n%Fb&UUF&bKkW`)R20;%jfA5K@s#_Mqfw`iq42X@bb`k6GH5>H}TQ$ul&9F&7)B7*v-{8NLo7jxs(5WccqNv!02N-c5 zv^lJUPhhj4NMMV=R`&Ey)Zaptatk#A+y21z+t4Uel)tcRj{jr4WqqJmpsN*rJh(6z u?NpJ!;4Id}XR$Uujde3Uo2y1}cGJPL-oW2 /dev/null && touch .${CONTEXT}_timestamp & + echo "Rendering icons from $CONTEXT.svg" + genInkscapeCmds $CONTEXT | java SplitJob $INKSCAPE --shell && touch .${CONTEXT}_timestamp else echo "No changes to $CONTEXT.svg, skipping..." fi done -wait - # Remove all empty directories from the theme folder. find $THEMEDIR -type d -empty -delete