Unum blog: Apple to Apple Comparison: M1 Max vs Intel. How a DDR5-powered MacBook beat a DDR4-powered MacBook and approached a $50K Server in Hash-Table Benchmarks unum.cloud/post/2021-12-2…
πŸ‘︎ 367
πŸ’¬︎
πŸ“…︎ Dec 24 2021
🚨︎ report
Benchmarking C++ Hash-Tables on ο£Ώ M1 Max MacBooks with DDR5, ο£Ώ Intel MacBooks with DDR4 and a $50K AMD Server unum.cloud/post/2021-12-2…
πŸ‘︎ 82
πŸ’¬︎
πŸ‘€︎ u/ashvar
πŸ“…︎ Dec 21 2021
🚨︎ report
What's the difference between a hash table and a dictionary?

Sorry if this is a stupid question, I have been searching but din't find anything which could clarify to me the answer, (sorry for bad english)

πŸ‘︎ 3
πŸ’¬︎
πŸ‘€︎ u/ruffer24
πŸ“…︎ Jan 17 2022
🚨︎ report
On HASH-TABLEs performance

I built an implementation of the A* algorithm which internally uses two HASH-TABLEs:

  • cost-so-far, mapping all the searched states the cost required to get there, from the initial state -- this is used to calculate the final cost to move from the initial state to the goal one
  • come-from, mapping all the searched states to their previous state -- this is used to calculate the complete path to move from the initial state to the goal one

As I was profiling this, I came to the conclusions that representing search states with 2D ARRAYs instead of HASH-TABLEs of the same size would have a huge positive impact on the overal runtime (i.e. it's better to use the former than the latter), but I cannot quite understand why, hence this post.

Now, it does not matter if you are not familiar with A*; in fact, we can completely ignore all its mechanics and simply pretend we have two HASH-TABLEs we need to update. In addition, let's pretend our search state was a 2 rows by 10 columns grid, with numbers in it.

I came up with (and benchmarked) the following 3 state representations:

  1. HASH-TABLE having (row col) as keys
  2. HASH-TABLE having (+ (* row 100) col) as keys -- this to rule out any excessive consing from the above
  3. 2D ARRAY

The benchmark is simple:

  • We initialize cost-so-far and come-from hash tables
  • We initialize our starting grid
  • Then, 10000 times
  • We copy the grid (I used ALEXANDRIA:COPY-HASH-TABLE and ALEXANDRIA:COPY-ARRAY for this)
  • Move two random elements
  • Save the new state inside cost-so-far and come-from

Here is the run time for the first state representation, HASH-TABLE with LISTs as

... keep reading on reddit ➑

πŸ‘︎ 4
πŸ’¬︎
πŸ‘€︎ u/landimatte
πŸ“…︎ Jan 10 2022
🚨︎ report
create a hash table from a txt file

i want to create a hash table fom a txt file that has 149 keys

each line in the txt is in this format 1.word:meaning

I'am stiil new to hashing so i don't know how to start

πŸ‘︎ 4
πŸ’¬︎
πŸ‘€︎ u/peachesdub
πŸ“…︎ Jan 01 2022
🚨︎ report
why a hash table is not suited to implement a sorted map.

Basically, I don't know a clear difference between a map and a hash table ,but I know how a hash table works and all the stuff, Can u help me with this question pls!!

πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/mutualsuspects
πŸ“…︎ Jan 04 2022
🚨︎ report
Patent granted Dec 28, 2021: "Method and system for verifying ownership of a digital asset using a distributed hash table and a peer-to-peer distributed ledger " This appears to be a very important and to do with SPV and proving the existence of data. twitter.com/cryptorebel_S…
πŸ‘︎ 23
πŸ’¬︎
πŸ‘€︎ u/Truth__Machine
πŸ“…︎ Jan 01 2022
🚨︎ report
A tale of Java Hash Tables andreinc.net/2021/11/08/a…
πŸ‘︎ 113
πŸ’¬︎
πŸ‘€︎ u/nomemory
πŸ“…︎ Nov 23 2021
🚨︎ report
Writing a fast and concurrent hash table/tree. Or do I even need one?

So. I'm writing a mid-level VM in C11, and it has come to the part where the application reads a bytecode file and assigns a module name to it. These modules are organized in trees, which essentially represent a file system. So you could think of it as a VFS.

For the application to execute bytecode after said bytecode has been loaded, it needs to query the already loaded files for symbols appearing in the executing code, which are all in fully qualified names. So my system resembles the JVM somewhat. For this querying task, I figured a hash table would be perfect, as a backbone to the VFS-like interface.

Here's the problem: I've written hash tables before, but I'm not so sure on how to optimize one for reliability, speed and concurrency (multiple threads can be loading bytecode simultaneously) and I'd need a little hint on this sorta stuff. I know some common optimization points of a hash table include the cost of expanding one, the speed of the hash function and queries, but as said I do not have experience on speeding things up. So, would someone who knows about this give some ways of making a hash table fast and thread-safe?

Apologies if this is the wrong subreddit.

πŸ‘︎ 9
πŸ’¬︎
πŸ‘€︎ u/valtzz00
πŸ“…︎ Jan 04 2022
🚨︎ report
Hash table on 8-bit PIC16?

I have a data stream I'm reading that has addresses 0-9999. I'm currently able to read and display them just fine on my PIC16. What I'd like to do is keep track of how many have been seen "recently". Typically this would be on the order of 5-25, perhaps with an absolute maximum of 100 addresses in use at any one time.

My thought was to do a hash table of some sort. Each entry would be a 8-bit count-down timer to indicate the freshness. This would give me the following functions I'd like to have:

add_or_update(address) -- add address to the hash table if necessary, set it's count-down timer to 255.

decrement() - For each entry in the hash table decrement the timer by 1 if > 0, if 0 remove entry.

count() - How many entries are currently in the hash table.

Where I'm a bit stuck is a hash table implementation. There are obviously hundreds out there, but most are tuned to modern 32-bit or higher CPUs. I need something that's going to be reasonably performant on a PIC16 with its instruction set.

Can anyone provide pointers to hash table algorithms specifically for 8-bit CPU's, or the PIC16, or thoughts on how to handle my use case above? I've googled around a bit and not found anything I considered very helpful yet.

πŸ‘︎ 7
πŸ’¬︎
πŸ‘€︎ u/nscale
πŸ“…︎ Dec 24 2021
🚨︎ report
Sounds like her and Matt β€œThanksgiving is awesome” Taibbi need to hash it out around the dinner table opendemocracy.net/en/5050…
πŸ‘︎ 16
πŸ’¬︎
πŸ‘€︎ u/ilikeyoohoo
πŸ“…︎ Nov 26 2021
🚨︎ report
Create a hash table where the key uses a wildcard?

Hi all,

I'm trying to scan through a column in my dataframe, df, and compare each cell to a hash table. I've been using the Hash package for this, and its been going well so far (much faster than using two dataframes and nested for loops to run individual comparisons!). However, I just realized I wanted to add a new key:value pair to my hash table, where the key includes a wildcard. For example, if the key:value pairing was "ab*c:def" then searching the hash table for "abc" "ab1c" "ab123c" etc would all return "def."

Is this possible, or would I need to look to another data structure to perform this sort of thing? Overall what I am trying to do is check each cell in this column of df, see if it corresponds to a key:value pair of interest, and if yes, update a different column in df with the associated value it found from the hash table.

Thanks for any help you can offer!

πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/quiet_hunter
πŸ“…︎ Jan 14 2022
🚨︎ report
Implementing hash tables in C (separate chaining), and a little theory andreinc.net/2021/10/02/i…
πŸ‘︎ 203
πŸ’¬︎
πŸ‘€︎ u/nomemory
πŸ“…︎ Oct 16 2021
🚨︎ report
Benchmarking Hash-Tables Speed on ο£Ώ M1 Max MacBooks with DDR5, ο£Ώ Intel MacBooks with DDR4 and a $50K AMD Server unum.cloud/post/2021-12-2…
πŸ‘︎ 4
πŸ’¬︎
πŸ‘€︎ u/ashvar
πŸ“…︎ Dec 21 2021
🚨︎ report
US Patent Application for METHOD AND SYSTEM FOR SECURING COMPUTER SOFTWARE USING A DISTRIBUTED HASH TABLE AND A BLOCKCHAIN Patent Application (Application #20210374214 issued December 2, 2021) patents.justia.com/patent…
πŸ‘︎ 10
πŸ’¬︎
πŸ‘€︎ u/Truth__Machine
πŸ“…︎ Dec 17 2021
🚨︎ report
I have to create a hash table of imported dictionary words. I have no idea what to do with this method provided by the textbook for adding to the table.

Basically we were given a txt file with the dictionary words, and some starter code from our textbook. Now, this is some custom written stuff so I can't really compare it to Java's implementation which is really confusing me.

There is this method called put() which I would guess is similar to add() in Java. Here is the thing though:

>public void put(Key key,
>
>Value val)
>
>Inserts the specified key-value pair into the symbol table, overwriting the old value with the new value if the symbol table already contains the specified key. Deletes the specified key (and its associated value) from this symbol table if the specified value is null.

What do I do with the Key key and Value val? I would assume all I had to do is pass the dictionary word (String) into the method and it would has it and appropriately place it. The fact that there are two arguments doesn't make sense to me.

TLDR: why are their two arguments in the method? I don't know where it should be inserted, the hash function should know...

Oh also, there is indeed a hashing function that is set to private in the textbook imported code. So there's that.

Reference: https://algs4.cs.princeton.edu/code/edu/princeton/cs/algs4/SeparateChainingHashST.java.html

πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/Willy988
πŸ“…︎ Dec 09 2021
🚨︎ report
A tale of Java Hash Tables andreinc.net/2021/11/08/a…
πŸ‘︎ 44
πŸ’¬︎
πŸ‘€︎ u/nomemory
πŸ“…︎ Nov 23 2021
🚨︎ report
"Implementing Hash Tables in C" (an article I've drafter a few years ago, but never published it until... now) andreinc.net/2021/10/02/i…
πŸ‘︎ 136
πŸ’¬︎
πŸ‘€︎ u/nomemory
πŸ“…︎ Oct 14 2021
🚨︎ report
Why does my Intel Skylake / Kaby Lake CPU incur a mysterious factor 3 slowdown in a simple hash table implementation? stackoverflow.com/questio…
πŸ‘︎ 117
πŸ’¬︎
πŸ‘€︎ u/mttd
πŸ“…︎ Oct 24 2021
🚨︎ report
Introduction to Hash Tables bytethisstore.com/article…
πŸ‘︎ 6
πŸ’¬︎
πŸ‘€︎ u/byte-this
πŸ“…︎ Dec 24 2021
🚨︎ report
Help needed with implementating Distributed Hash Tables in Python for a P2P system

Hey guys, I'm fairly new to Python and I need to know if anyone can point me in the direction of any resources that can help me with the issue in the title. It's for a school project. I've tried looking around but I've found no luck.

Thanks in advance.

πŸ‘︎ 3
πŸ’¬︎
πŸ‘€︎ u/Infamous_Gur_7718
πŸ“…︎ Dec 12 2021
🚨︎ report
How do I compare the performance of linear probing vs separate chaining (for hash table) in my code?

My textbook provides two classes, one for linear probing and one for separate chaining. I've successfully made a spell checker using one. My next step for extra credit is to implement the other and compare/describe performance differences. How exactly do I go about doing this? I have no idea how to prove anything.

πŸ‘︎ 7
πŸ’¬︎
πŸ‘€︎ u/Willy988
πŸ“…︎ Dec 10 2021
🚨︎ report
Is it ever not okay to use hash tables due to their worst case time complexity?

I realise that this isn't something that will be an issue while submitting to leetcode but in interviews does it ever happen that the interviewer wants guarantees on the worst case time complexity?

πŸ‘︎ 12
πŸ’¬︎
πŸ‘€︎ u/__randomuser__
πŸ“…︎ Nov 03 2021
🚨︎ report
Storing Hash Tables/Calculated Properties in Array

Hey guys, long time lurker. I'm at my wits end with trying to optimize this script. I'm pulling resource values from servers to generate an e-mail report. For the sake of not posting the whole script, I'm gonna focus on the parts of the script with storage info.

I'm trying to simplify the use of my Select-Object statements, and wanted to store my calculated properties in an array to pass as an argument. (Not even sure if what I'm saying makes sense, I digress.)

This is what my (sad) attempt at doing this currently looks like, I've tried many (bonehead) iterations and cannot for the life of me get this to work.

$DriveSpaceTableObjects = @(
    @{'Name' = 'Drive Letter'; Expression= {$_.DeviceID}}
    @{'Name' = '% Utilization'; Expression= {(($_.Size - $_.FreeSpace) / $_.Size).ToString('P')}}
    @{'Name' = 'Size (GB)'; Expression= {[int]($_.Size / 1GB) }}
    @{'Name' = 'Free (GB)'; Expression= {[int]($_.FreeSpace / 1GB) }}
    @{'Name' = 'Server'; Expression = {$env:COMPUTERNAME}}
)
Get-CimInstance -ClassName Win32_LogicalDisk | Where-Object {$_.DriveType -notlike 4 -and $_.DriveType -notlike 5} | Select-Object $DriveSpaceTableObjects

Here's what's frustrating, this works for the above, but when I try to pass it with Invoke-Command as below:

$dcserverspaceremote = Invoke-Command -Authentication Kerberos -ComputerName $DCServers -ScriptBlock{
    Get-CimInstance -ClassName Win32_LogicalDisk | Where-Object {$_.DriveType -notlike 4 -and $_.DriveType -notlike 5} | Select-Object $Using:DriveSpaceTableObjects
}}

It doesn't work. I cannot figure out why. Please help. Lol

EDIT:

Here are the responses for the respective commands.

Local Get-CimInstance

Drive Letter  : C:
% Utilization : 37.05 %
Size (GB)     : 200
Free (GB)     : 126
Server        : EXAMPLESERVER

Invoke-Command

Drive Letter   : 
% Utilization  : 
Size (GB)      : 
Free (GB)      : 
Server         : 
PSComputerName : EXAMPLESERVER.EXAMPLE.LOCAL
RunspaceId     : 93767eab-5cf7-4018-9791-c94d5961b5bb

EDIT FROM COMMENT:

Okay, I'm onto something. See the following:

Using this array (Modification on the last line)

$DriveSpaceTableObjects = @(
    @{'Name' = 'Drive Letter'; 'Expression' = {$_.DeviceID}}
    @{'Name' = '% Utilization'; 'Expression' = {(($_.Size - $_.FreeSpace) / $_.Size).ToString('P')}}
    @{'Name' = 'Size (GB)'; 'Expression' = {[int]($_.Size / 1GB)}}
... keep reading on reddit ➑

πŸ‘︎ 10
πŸ’¬︎
πŸ‘€︎ u/Yzzel
πŸ“…︎ Oct 20 2021
🚨︎ report
[C programming] Hash tables, ADTs [$150]

Hello, have quite a complex home brewed abstract data type HW assignment I need help on. Involves using an interface already programmed for you that will interface with a hash table. You just have to do the user input part. Quite a few files and criteria, not for the faint of heart.

πŸ‘︎ 3
πŸ’¬︎
πŸ‘€︎ u/amishguy222000
πŸ“…︎ Nov 24 2021
🚨︎ report
Antminer Hash Board Test Fixture Table
πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/Moustache_Group
πŸ“…︎ Nov 27 2021
🚨︎ report
need assistance with hash table (probably)

My weakness in PowerShell is that I don't use or fully understand hash tables. Yes, I realize the importance, and Yes, I plan to fix that, but at the moment, I need assistance with an urgent (according to my boss) problem.

The goal: Look through a fileserver of a couple million files and find:

  1. How many files each person owns
  2. The total size of the files they own

I have an easy one liner that recursively checks the server for all files. It finds the owner and size (i.e. length). I've left out the option "-Force" because I'm not interested in hidden files.

Get-ChildItem -file -Recurse | Select @{Name="Owner";Expression={(Get-ACL $_.Fullname).Owner}},length | ft -HideTableHeaders

This leaves me with something like:

user1 1000
user2 2000
user3 3000
user2 4000

Etc. The information is there, but what I want to do is count the recurrence of each user (easy), but also get the sum total of the file sizes (here as "length") for each user. In my example above, this would look like:

user1, 1, 1000
user2, 2, 6000
user3, 1, 3000

And so on.

For a small number of files, I'd solve the immediate problem by putting this in a spreadsheet or something, but that seems impractical with 2 million files.

Any hash masters out there willing to share some code?

Thanks.

[edit]

A couple of really good suggestions here. I will check these out tomorrow when I'm back in the office. Thanks, everyone.

πŸ‘︎ 22
πŸ’¬︎
πŸ‘€︎ u/ReddyFreddy-
πŸ“…︎ Oct 17 2021
🚨︎ report
[Blog] PowerShell Hash Table vs. PSCustomObject: Deep Dive & Comparison | Jeff Brown Tech jeffbrown.tech/powershell…
πŸ‘︎ 13
πŸ’¬︎
πŸ‘€︎ u/jeffbrowntech
πŸ“…︎ Nov 03 2021
🚨︎ report
Load Factor in Hash Tables

Hey guys, I had a small doubt in hashing. When we are talking about the load factor, we say that it should be less than 1. If it is 1 or more, we rehash.

Load factor = n/N where n = number of entries in the structure; N= number of slots in the array.

If I have 10 elements and 10 slots in the array, then the load factor is 1. How is this load factor bad? If each slot has 1 entry, isn't that good?

πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/zennygirl12
πŸ“…︎ Nov 16 2021
🚨︎ report
Just got introduced to hash tables, do I understand it right?

Here's what I think it is:

  • You store a key and a value at an index.
  • It is usually an array of arrays or linked lists etc
  • As the name suggests, you want to have a hash method that converts the value into the proper index and make sure it's unique (For anagrams etc)
  • It is unordered
  • It is nice to be able to find a value based on a key or vice versa
  • It is really fast to insert or find a key/value

Does that sound right? Anything I missed? Thanks!

πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/Willy988
πŸ“…︎ Nov 19 2021
🚨︎ report

Please note that this site uses cookies to personalise content and adverts, to provide social media features, and to analyse web traffic. Click here for more information.