Для меня время выполнения этого сравнения: 1`g < 2`g
выглядит намного медленнее в Maxima 5.42.0 (и 5.42.2, 5.43.0 и 5.43.2), чем в 5.41.0. (Обратите внимание, что первый запуск всегда медленнее.)
Произошло ли изменение между 5.41.0 и 5.42.0, которое могло вызвать это замедление? Или я что-то не так делаю?
Пример времени выполнения:
Максимум 5.41.0 с SBCL 1.5.7
Maxima 5.41.0 http://maxima.sourceforge.net
using Lisp SBCL 1.5.7
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) showtime:true;
Evaluation took 0.0000 seconds (0.0000 elapsed) using 0 bytes.
(%o1) true
(%i2) load(ezunits);
Evaluation took 2.7650 seconds (2.7780 elapsed) using 1046.148 MB.
(%o2) /usr/local/share/maxima/5.41.0/share/ezunits/ezunits.mac
(%i3) 1`g < 1`g;
Evaluation took 0.0860 seconds (0.0860 elapsed) using 33.078 MB.
(%o3) 1 < 1
(%i4) 1`g < 1`g;
Evaluation took 0.0040 seconds (0.0040 elapsed) using 511.469 KB.
(%o4) 1 < 1
(%i5) 1`g < 1`g;
Evaluation took 0.0040 seconds (0.0040 elapsed) using 543.547 KB.
(%o5) 1 < 1
Maxima 5.42.0 с SBCL 1.5.7
Maxima 5.42.0 http://maxima.sourceforge.net
using Lisp SBCL 1.5.7
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) showtime:true;
Evaluation took 0.0000 seconds (0.0010 elapsed) using 0 bytes.
(%o1) true
(%i2) load(ezunits);
Evaluation took 2.6460 seconds (2.6600 elapsed) using 1033.502 MB.
(%o2) /usr/local/share/maxima/5.42.0/share/ezunits/ezunits.mac
(%i3) 1`g < 2`g;
Evaluation took 1.0400 seconds (1.0400 elapsed) using 434.087 MB.
(%o3) 1 < 2
(%i4) 1`g < 2`g;
Evaluation took 0.4350 seconds (0.4360 elapsed) using 170.099 MB.
(%o4) 1 < 2
(%i5) 1`g < 2`g;
Evaluation took 0.4330 seconds (0.4340 elapsed) using 170.119 MB.
(%o5) 1 < 2
Кажется, что это не имеет отношения к версии Lisp.
Maxima 5.42.0 с Clisp 2.49
Maxima 5.42.0 http://maxima.sourceforge.net
using Lisp CLISP 2.49 (2010-07-07)
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) showtime:true;
Evaluation took 0.0000 seconds (0.0000 elapsed) using 56 bytes.
(%o1) true
(%i2) load(ezunits);
Evaluation took 5.4127 seconds (5.4136 elapsed) using 82.926 MB.
(%o2) /usr/local/share/maxima/5.42.0/share/ezunits/ezunits.mac
(%i3) 1`g < 2`g;
Evaluation took 1.7984 seconds (1.7984 elapsed) using 53.569 MB.
(%o3) 1 < 2
(%i4) 1`g < 2`g;
Evaluation took 0.1951 seconds (0.1951 elapsed) using 3.291 MB.
(%o4) 1 < 2
(%i5) 1`g < 2`g;
Evaluation took 0.1597 seconds (0.1598 elapsed) using 3.291 MB.
(%o5) 1 < 2
Я сам компилирую версии Maxima и Lisp в Docker, поэтому могу запустить его на AWS Lambda, используя следующие команды:
wget --quiet --output-document sbcl-1.5.7-source.tar.bz2 https://sourceforge.net/projects/sbcl/files/sbcl/1.5.7/sbcl-1.5.7-source.tar.bz2/download \
&& tar --bzip2 -xf sbcl-1.5.7-source.tar.bz2 \
&& cd sbcl-1.5.7 \
&& sh make.sh "clisp" \
&& sh install.sh
wget --quiet --output-document maxima-5.42.0.tar.gz https://sourceforge.net/projects/maxima/files/Maxima-source/5.42.0-source/maxima-5.42.0.tar.gz/download \
&& tar -xzvf maxima-5.42.0.tar.gz \
&& cd maxima-5.42.0 \
&& ./configure --enable-sbcl-exec \
&& make \
&& make install
Обновление
Мы сами пытались разобраться в проблеме. К сожалению, у нас недостаточно опыта работы с lisp, чтобы найти решение.
Мы обнаружили, что производительность была хорошей, когда мы использовали предварительно скомпилированную версию Maxima 5.43.0 с использованием GCL. Эту версию можно найти здесь: https://sourceforge.net/projects/maxima/files/Maxima-Linux/5.43.0-Linux/
Maxima 5.43.0 с GCL 2.6.12
Maxima 5.43.0 http://maxima.sourceforge.net
using Lisp GNU Common Lisp (GCL) GCL 2.6.12
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) showtime:true;
Evaluation took 0.0000 seconds (0.0000 elapsed)
(%o1) true
(%i2) load(ezunits);
Evaluation took 0.4100 seconds (0.5600 elapsed)
(%o2) /usr/share/maxima/5.43.0/share/ezunits/ezunits.mac
(%i3) 1`g < 2`g;
Evaluation took 0.1700 seconds (0.1700 elapsed)
(%o3) 1 < 2
(%i4) 1`g < 2`g;
Evaluation took 0.0500 seconds (0.0500 elapsed)
(%o4) 1 < 2
Это также было выполнено в docker контейнере. Maxima была установлена с помощью этих команд:
wget --quiet https://downloads.sourceforge.net/project/maxima/Maxima-Linux/5.43.0-Linux/maxima-5.43.0-1.x86_64.rpm \
&& wget --quiet https://downloads.sourceforge.net/project/maxima/Maxima-Linux/5.43.0-Linux/maxima-exec-gcl-5.43.0-1.x86_64.rpm \
&& rpm --install --verbose --hash maxima-5.43.0-1.x86_64.rpm maxima-exec-gcl-5.43.0-1.x86_64.rpm