{"id":411,"date":"2010-08-15T17:25:48","date_gmt":"2010-08-15T17:25:48","guid":{"rendered":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/tak-como-prueba-de-rendimiento\/"},"modified":"2013-03-08T05:53:42","modified_gmt":"2013-03-08T05:53:42","slug":"tak-como-prueba-de-rendimiento","status":"publish","type":"post","link":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/tak-como-prueba-de-rendimiento\/","title":{"rendered":"TAK como prueba de rendimiento"},"content":{"rendered":"<p>A partir del\u00a0art\u00edculo\u00a0<a href=\"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/la-funcion-de-takeuchi-como-banco-de-prueba-para-la-eficiencia\">La funci\u00f3n de Takeuchi como banco de prueba para la eficiencia<\/a> y\u00a0sus comentarios he estado investigando sobre su uso. En este art\u00edculo\u00a0resumo el resultado de las indagaciones.<\/p>\n<p>La funci\u00f3n de Takeuchi se utiliza en la prueba TAK cuyo creador\u00a0es <a href=\"http:\/\/en.wikipedia.org\/wiki\/Richard_P._Gabriel\"> Richard\u00a0P. Gabriel<\/a> seg\u00fan afirma en su\u00a0libro\u00a0<a href=\"http:\/\/www.dreamsongs.com\/NewFiles\/Timrep.pdf\">Performance and evaluation of LISP systems<\/a> (MIT Press, 1985). En\u00a0las p\u00e1ginas 81-91 de su libro describe la prueba TAK. En concreto, \u00a0indica su objetivo (p. 81)<br \/>\n<!--more--><\/p>\n<blockquote><p><em>The TAK benchmark is a variant of the Takeuchi function that \u00a0Ikuo\u00a0Takeuchi of Japan used as a simple benchmark. Because Tak is\u00a0function-call-heavy, it is representative of many Lisp programs. On\u00a0the other hand, because it does little else but function calls\u00a0(fixnum arithmetic is performed as well), it is not representative\u00a0of the majority of Lisp programs. It is only a good test of function\u00a0call and recursion, in particular.<\/em><\/p><\/blockquote>\n<p>su creaci\u00f3n (p. 81)<\/p>\n<blockquote><p><em>When the Computer Science Department at Stanford University\u00a0obtained the first two or three Xerox Dolphins, John McCarthy asked\u00a0me to do a simple benchmark test with him. We sat down, and he tried\u00a0to remember the Takeuchi function, which had had wide\u00a0circulation. Because it was simple and because there were many\u00a0results for it in the literature, he felt that it would be a good\u00a0initial test. Of course, John misremembered the function. But we did\u00a0not realize it until I had gathered a great many numbers for\u00a0it. Alas, we are stuck with this variant on Takeuchi.<\/em><\/p><\/blockquote>\n<p>y su definici\u00f3n (p. 82) que consiste en dado el programa<\/p>\n<pre lang=\"lisp\">(defun tak (x y z)\r\n  (if (not (&lt; y x))\r\n      z\r\n      (tak (tak (1- x) y z)\r\n           (tak (1- y) z x)\r\n           (tak (1- z) x y))))<\/pre>\n<p>calcular el tiempo necesario para calcular (tak 18 12 6). En las\u00a0p\u00e1ginas 82-91 Gabriel analiza y comenta los resultados obtenidos con la\u00a0prueba TAK en distintas implementaciones de Lisp.<\/p>\n<p>Adem\u00e1s de TAK, en el cap\u00edtulo 3 del libro se presenta algunas\u00a0variantes (STAK, CTAK, TAKL y TAKR) y otras 15 pruebas de\u00a0rendimiento. El conjunto de las 20 pruebas forman\u00a0el\u00a0<a href=\"http:\/\/www.cs.cmu.edu\/afs\/cs\/project\/ai-repository\/ai\/lang\/lisp\/code\/bench\/gabriel\/0.html\">Gabriel&#8217;s Lisp Benchmarking Suite<\/a>.<\/p>\n<p>Las prueba de rendimiento de Gabriel, juntos con otras pruebas de\u00a0rendimiento constituyen\u00a0el\u00a0<a href=\"http:\/\/www.chez.com\/emarsden\/downloads\/cl-bench.tar.gz\">cl-bench (The Common-Lisp benchmarking suite)<\/a> de Eric Marsden. En\u00a0cl-bench, las pruebas de Gabriel est\u00e1n en el\u00a0fichero <a href=\"http:\/\/common-lisp.net\/websvn\/filedetails.php?repname=cl-bench&amp;path=%2Ftrunk%2Ffiles%2Fgabriel.lisp&amp;rev=0&amp;sc=0\">gabriel.lisp<\/a> y la prueba TAK es<\/p>\n<pre lang=\"lisp\">(defun tak (x y z)\r\n  (declare (fixnum x y z))\r\n  (if (not (&lt; y x))\r\n      z\r\n      (tak (tak (the fixnum (1- x)) y z)\r\n           (tak (the fixnum (1- y)) z x)\r\n           (tak (the fixnum (1- z)) x y))))\r\n\r\n(defun run-tak ()\r\n  (tak 18 12 6))<\/pre>\n<p>Las pruebas de rendimiento de Common Lisp\u00a0(<a href=\"http:\/\/www.chez.com\/emarsden\/downloads\/cl-bench.tar.gz\">cl-bench<\/a>) trae guiones que permiten compararlas sobre distintas\u00a0implementaciones de Lisp, entre las que se encuentran CLISP, CMUCL,\u00a0ECL, GCL, LispWorks, PopLog y SBCL.<\/p>\n<p>Los resultados de las pruebas de rendimiento con Common Lisp sobre 7\u00a0implementaciones de Lisp puede consultarse\u00a0en\u00a0<a href=\"http:\/\/www.cliki.net\/Performance%20Benchmarks2\">Performance Benchmarks2<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A partir del\u00a0art\u00edculo\u00a0La funci\u00f3n de Takeuchi como banco de prueba para la eficiencia y\u00a0sus comentarios he estado investigando sobre su uso. En este art\u00edculo\u00a0resumo el resultado de las indagaciones. La funci\u00f3n de Takeuchi se utiliza en la prueba TAK cuyo creador\u00a0es Richard\u00a0P. Gabriel seg\u00fan afirma en su\u00a0libro\u00a0Performance and evaluation of LISP systems (MIT Press, 1985)&#8230;.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"footnotes":"","_jetpack_memberships_contains_paid_content":false},"categories":[92,95],"tags":[283,284,94],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_likes_enabled":false,"_links":{"self":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/wp-json\/wp\/v2\/posts\/411"}],"collection":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/wp-json\/wp\/v2\/comments?post=411"}],"version-history":[{"count":9,"href":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/wp-json\/wp\/v2\/posts\/411\/revisions"}],"predecessor-version":[{"id":3039,"href":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/wp-json\/wp\/v2\/posts\/411\/revisions\/3039"}],"wp:attachment":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/wp-json\/wp\/v2\/media?parent=411"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/wp-json\/wp\/v2\/categories?post=411"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/wp-json\/wp\/v2\/tags?post=411"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}