<?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[map schneller als array?]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich laufe in einer schleife die ca. 800 000 iterationen macht.<br />
Dort greife ich auf ein array derselben grösse zu über array[idx + offset] hole<br />
ich mir werte aus dem array.<br />
Jetzt ist mir das zu langsam. Kann es sein wenn ich statt dess arrays nun eine einfach map benutze dies schneller wird? Oder überseh ich da was. Ich dachte bei hashes sind die zugriffe schneller?!?</p>
<p>Danke für hilfe!</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/156435/map-schneller-als-array</link><generator>RSS for Node</generator><lastBuildDate>Tue, 08 Sep 2026 19:43:13 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/156435.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 16 Aug 2006 16:12:46 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to map schneller als array? on Wed, 16 Aug 2006 16:12:46 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich laufe in einer schleife die ca. 800 000 iterationen macht.<br />
Dort greife ich auf ein array derselben grösse zu über array[idx + offset] hole<br />
ich mir werte aus dem array.<br />
Jetzt ist mir das zu langsam. Kann es sein wenn ich statt dess arrays nun eine einfach map benutze dies schneller wird? Oder überseh ich da was. Ich dachte bei hashes sind die zugriffe schneller?!?</p>
<p>Danke für hilfe!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1118535</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1118535</guid><dc:creator><![CDATA[Mati]]></dc:creator><pubDate>Wed, 16 Aug 2006 16:12:46 GMT</pubDate></item><item><title><![CDATA[Reply to map schneller als array? on Wed, 16 Aug 2006 16:26:20 GMT]]></title><description><![CDATA[<p>Willst du wissen, ob der Indexzugriff über ein Array schneller ist wie der Zugriff über die Map?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1118548</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1118548</guid><dc:creator><![CDATA[Vertexwahn]]></dc:creator><pubDate>Wed, 16 Aug 2006 16:26:20 GMT</pubDate></item><item><title><![CDATA[Reply to map schneller als array? on Wed, 16 Aug 2006 16:28:07 GMT]]></title><description><![CDATA[<p>ja richtig <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1118552</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1118552</guid><dc:creator><![CDATA[Mati]]></dc:creator><pubDate>Wed, 16 Aug 2006 16:28:07 GMT</pubDate></item><item><title><![CDATA[Reply to map schneller als array? on Wed, 16 Aug 2006 16:30:39 GMT]]></title><description><![CDATA[<p>und da wir schon dabei sind...<br />
noch ne frage...ist der zugriff auf ein statisches array schneller als auf einen std::vector&lt;int&gt; ? Oder ist das gleich schnell?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1118555</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1118555</guid><dc:creator><![CDATA[Mati]]></dc:creator><pubDate>Wed, 16 Aug 2006 16:30:39 GMT</pubDate></item><item><title><![CDATA[Reply to map schneller als array? on Wed, 16 Aug 2006 16:34:03 GMT]]></title><description><![CDATA[<p>Ein Arrayzugriff über den Index ist immer schneller oder gleichschnell wie der Zugriff auf eine Map</p>
<p>Ein Arrayzugriff ist ja nur eine Addition auf eine bestimmte Adresse, die dann auf das spezifische Arrayelement verweist</p>
<p>Eine Map kann z. B. Auch ein Array sein mit einem Hashingalgorithmus - das heißt für den Zugriff auf das Array kostet was (genauso viel wie nur Array) + die Berechnung des Hashwertes + auflösen von eventuellen Kollisionen usw. was beim Hashing so alles halt passieren kann</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1118556</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1118556</guid><dc:creator><![CDATA[Vertexwahn]]></dc:creator><pubDate>Wed, 16 Aug 2006 16:34:03 GMT</pubDate></item><item><title><![CDATA[Reply to map schneller als array? on Wed, 16 Aug 2006 16:37:13 GMT]]></title><description><![CDATA[<blockquote>
<p>und da wir schon dabei sind...<br />
noch ne frage...ist der zugriff auf ein statisches array schneller als auf einen std::vector&lt;int&gt; ? Oder ist das gleich schnell?</p>
</blockquote>
<p>das kommt auf den Compiler drauf an</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1118561</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1118561</guid><dc:creator><![CDATA[Vertexwahn]]></dc:creator><pubDate>Wed, 16 Aug 2006 16:37:13 GMT</pubDate></item><item><title><![CDATA[Reply to map schneller als array? on Wed, 16 Aug 2006 17:33:01 GMT]]></title><description><![CDATA[<p>Jo, und auf die Implementierung der STL. Im allgemeinen wird das aber in etwa gleichschnell sein.</p>
<p>Du hast hoffentlich im Release-Modus Deine Messungen gemacht?</p>
<p>Ansonsten kannst Du vielleicht mal verraten, was Du in etwa machen willst? Vielleicht gibt's dafür ein effizienteres Verfahren? Am reinen Zugriff wirste nicht viel ändern können.</p>
<p>edit: einmal reicht. Du brauchst die Frage nicht in mehrere Subforen stellen, da kommt man sich sonst irgendwie verarscht vor.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1118609</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1118609</guid><dc:creator><![CDATA[Jester]]></dc:creator><pubDate>Wed, 16 Aug 2006 17:33:01 GMT</pubDate></item><item><title><![CDATA[Reply to map schneller als array? on Wed, 16 Aug 2006 19:04:11 GMT]]></title><description><![CDATA[<p>Dieser Thread wurde von Moderator/in <a href="http://www.c-plusplus.net/forum/profile.php?mode=viewprofile&amp;u=5577" rel="nofollow">rapso</a> aus dem Forum <a href="http://www.c-plusplus.net/forum/viewforum.php?f=7" rel="nofollow">Spiele-/Grafikprogrammierung</a> in das Forum <a href="http://www.c-plusplus.net/forum/viewforum.php?f=15" rel="nofollow">C++</a> verschoben.</p>
<p>Im Zweifelsfall bitte auch folgende Hinweise beachten:<br />
<a href="http://www.c-plusplus.net/forum/viewtopic.php?t=39405" rel="nofollow">C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?</a></p>
<p><em>Dieses Posting wurde automatisch erzeugt.</em></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1118683</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1118683</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Wed, 16 Aug 2006 19:04:11 GMT</pubDate></item><item><title><![CDATA[Reply to map schneller als array? on Wed, 16 Aug 2006 19:27:35 GMT]]></title><description><![CDATA[<p>Also, nur so als Frage, du tust bei den Iterationen aber keine einfüge Operationen<br />
in den vector vornehmen, oder?<br />
Und, kannst du uns evtl. mal den Code zeigen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1118697</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1118697</guid><dc:creator><![CDATA[phlox81]]></dc:creator><pubDate>Wed, 16 Aug 2006 19:27:35 GMT</pubDate></item></channel></rss>