Logo
Explore Help
Sign In
public/nixpkgs
1
0
Fork 0
You've already forked nixpkgs
Code Issues Pull Requests Packages Projects Releases Wiki Activity
nixpkgs/pkgs/tools/graphics/gnuplot/set-gdfontpath-from-fontconfig.sh

5 lines
130 B
Bash
Raw Normal View History

gnuplot: Improve startup performance Before executing the gnuplot executable the environment variable `GDFONTPATH` is populated with a list of font directories, which is obtained from `fc-list`. In that process we iterated over each line and called `dirname` on it, which introduces a performance hit for loading and executing the external executable `dirname` every time. The new version avoids the loop. The author of this patch measured a 42 fold performance improvement: old version: $ time ./gnuplot_old/bin/gnuplot -e '' real 0m3.828s user 0m0.392s sys 0m0.465s new version: $ time ./gnuplot_new2/bin/gnuplot -e '' real 0m0.091s user 0m0.112s sys 0m0.014s The correctness of the value of `GDFONTPATH` was confirmed with the following command and comparing its output between versions: $ gnuplot -e 'print system("echo $GDFONTPATH")'
2016-01-11 11:36:50 +01:00
p=( $(fc-list : file | sed "s@/[^/]*: @@" | sort -u) )
gnuplot: configure GDFONTPATH using 'fontconfig' This patch adds a wrapper script around gnuplot that uses fontconfig's fc-list(1) utility to determine the set of available fonts and makes that list available to Gnuplot in the $GDFONTPATH variable.
2013-02-18 00:00:48 +01:00
IFS=:
export GDFONTPATH="${GDFONTPATH}${GDFONTPATH:+:}${p[*]}"
unset IFS p
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.8 Page: 1773ms Template: 2ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API