<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[performance hash-to-list]]></title><description><![CDATA[<p>hi,</p>
<p>ist dieser code halbwegs performant, oder wird lst jedesmal umkopiert <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
<pre><code>(defun hash-to-list (ht)
  (progn
    (setf lst nil)
    (maphash #'(lambda (key value) (setf lst (cons (cons key value) lst))) ht)
    lst))
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/159392/performance-hash-to-list</link><generator>RSS for Node</generator><lastBuildDate>Thu, 09 Jul 2026 22:03:18 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/159392.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 14 Sep 2006 14:37:35 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to performance hash-to-list on Thu, 14 Sep 2006 14:37:35 GMT]]></title><description><![CDATA[<p>hi,</p>
<p>ist dieser code halbwegs performant, oder wird lst jedesmal umkopiert <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
<pre><code>(defun hash-to-list (ht)
  (progn
    (setf lst nil)
    (maphash #'(lambda (key value) (setf lst (cons (cons key value) lst))) ht)
    lst))
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1137399</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1137399</guid><dc:creator><![CDATA[Prentice Hall]]></dc:creator><pubDate>Thu, 14 Sep 2006 14:37:35 GMT</pubDate></item><item><title><![CDATA[Reply to performance hash-to-list on Thu, 14 Sep 2006 20:45:40 GMT]]></title><description><![CDATA[<p>Mach dir um die Performance keine Sorgen. Schreib das Programm, benutz einen Profiler und optimier die Funktionen, die es sich lohnt zu optimieren. Wobei ich an deinem Code aber einige Sachen nicht verstehe, zB warum du progn benutzt und den ersten Aufruf zu setf.</p>
<p>Ich würde die Funktion eher so implementieren (bin jetzt aber kein Lisp-Experte)</p>
<pre><code>(defun hash-to-list (hash)
  (let (list)
    (maphash #'(lambda (key value) 
                 (setf list (nconc list (cons key value)))) hash)
    list))
</code></pre>
<p>(nconc dürfte hier schneller sein, da nicht umkopiert, sondern ersetzt wird)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1137644</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1137644</guid><dc:creator><![CDATA[rüdiger]]></dc:creator><pubDate>Thu, 14 Sep 2006 20:45:40 GMT</pubDate></item></channel></rss>