Jump to content

Predict the Next Person to Post


Gyaradoskiller

Recommended Posts

8 hours ago, Dragon116 said:

 

 

That's pretty damn impressive. Did you use loop unrolling or something else?

Nah. It's all about understanding cache memory. For some reason, std::map is implemented using linked lists (it's actually a binary tree but the thing's that each node is allocated separatelly). That means that every jump from a node to another, both when searching and when iterating has a very high chance of being a cache miss. If we take into account that a querying data from the RAM takes more or less 100 times more than from the cache, the std::map wastes a huge amount of time just waiting for data. My implementation just makes a better use of cache memory, by making all the sorting and searching algorithms happen in a chunk of contiguous memory. You can take a look at the code here if you're interested: https://bitbucket.org/Lugruf/cache_friendly_map

 

Dragon?

Link to comment
Share on other sites

I am busy from when I sleep until I get home from work. Then I log in  here and see stuff.

 

I also have attempted to read that code, and I am lost in a lot of it. Generics in C++ have left me lost due to the raw syntax. C# and Java don't seem nearly that hard from the examples I have done and seen.

 

Lugruf?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...