Objects and associative arrays make more sense than just "hash table", hash table tells me nothing.
@mihaleben60513 күн бұрын
BRO DID NOT DRAW THE THUMB NAIL
@armandomorales44233 күн бұрын
In your hash function you have: t+hash&0x1ff0 Try avoid using the plus sign, trim the “t” and use another & or | instead of + … the reason for this is that + has to deal with carry (doing & and | ) if you deal with the carry you are saving computing
@ivannasha55564 күн бұрын
Meanwhile I'm over here crying about billion dollar companies. Not being able to make a snappy GUI on today's hardware. When 1MHz computers with 64k ram. Were faster than me in the 80s XD
@natescode4 күн бұрын
Wow this is such a gem of a video.
@R4ngeR4pidz7 күн бұрын
instructions != cycles
@anj00010 күн бұрын
I really appreciate error bars on your tests results. It is really uncommon sadly.
@MikkoRantalainen10 күн бұрын
I would have assumed that perfect hash would have been something like load the input string as one or two 64 bit numbers, xor each input with random-like static value, rotate one of the numbers another random amount and then xor the numbers together and use that as the hash value. And to find those random values, you just create a program that tries different combinations until you get a good hash. The important part is that you only randomize the static values to xor against each input and the shift amount before xor'ing the results which should result in micro-ops that can execute really fast. And check the generated assembly to verify that the compiler inlines your hash function instead of calling a real function. And try to make the compiler to unroll the loop if at all possible. If you have multiple words to check for being a keyword, CPU might be able to execute those tests in parallel if the loop is unrolled 2x or 4x times. Also consider the byte alignment. If you can have the words starting at 4 or 16 byte alignment, the CPU may be able to load the data faster. The important thing is to keep trying different methods and profile which one is the fastest and always assume most of the code will be CPU cache limited, not instruction limited. The hard part is that modern CPUs do not have great options to check if your limit is branch mispredict or RAM access.
@MrOnlineCoder12 күн бұрын
The burp at LCG moment was amazing
@matteac_rs13 күн бұрын
I had this video in my feed for like 3 weeks, I didn't want to watch it because hashing seems kinda boring but surprisingly it was the best video I have seen in a while
@DustinRodriguez1_015 күн бұрын
Legal Typescript source code files are expected to use UTF-8 for their character encoding format. Not ASCII. Be careful when making precise assumptions about your data (like that it includes only 8-bit ASCII characters).
@elvisadjei206219 күн бұрын
In conclusion, Node.Js isn't still bad bad afterall, it's just the hype for Bun that was a little too much to get us exited all this while.
@adityamwagh19 күн бұрын
Gilfoyle from Silicon Valley, is that you?
@kayakMike100019 күн бұрын
Uh... Why not use an enumerated type?
@kayakMike100019 күн бұрын
Uh. Nevermind. I figured out why that's a dumb idea.
@skeleton_craftGaming20 күн бұрын
I would probably name decode_UTF_8_result the same as you (I may remove the _ between the F and 8) But if it doesn't have any acronyms in it, I would just use camel case If it's truly a helper function, having it defined as a lambda inside of the function that it's helping seems better to me ... You're supposed to use std: unique 11:16 And on top of that I'm not always looking at my source control, which is why putting some sort of identifier there is a good idea
@johnsearing912820 күн бұрын
Where is the code?
@ErikBongers21 күн бұрын
I think the performance could be even better if you weren't using the Comic Sans font.
@lennysuessmuth951221 күн бұрын
I dont mean to sound like youre not doing it right. But I think most of your problems originate from resting your hands on the table. I noticed that the modifiers go way easier when you rest your ellbows on the armrests of your chair and approach the chorder from the top, rather than the way you would do on a keyboard.
@braineaterzombie398121 күн бұрын
I need that rusty gyatt
@xymaryai828322 күн бұрын
why Why did you feel the need to cake up Ferrous and C++
@NotoriousPyro22 күн бұрын
I have an application that is doing high frequency trading using several LMDB in-memory DBs and many loops. Running it on bun vs node is a no brainer. Bun wins many times over. Nobody cares if the tests took a bit longer to run, that is not affecting production use of your application. The real meat is in the production code performance. I would suggest the slow test running is probably indicative of an issue somewhere in bun, and once fixed it is likely to be faster. Possibly something in how you test is not being translated into optimal code.
@pedropesserl23 күн бұрын
so why was the binary search slower?
@codeking458523 күн бұрын
Gyatt
@xymaryai828322 күн бұрын
Ferrous Gyatt
@codeking458522 күн бұрын
@@xymaryai8283 oo yaaa 😂😂
@susugam300424 күн бұрын
i thought this was going to be a different kind of video, about building tables
@ratsalad34624 күн бұрын
4. Eytzinger binary search. This is much more cache-friendly.
@ratsalad34624 күн бұрын
Let's try this a third time. I cannot believe that I cannot leave a comment on a video. Does nothing work nowadays? Maybe KZbin doesn't like URLs in messages? Thank you for this. This is easily the most comprehensive presentation on keyword recognition that I have found anywhere on the Internet. I would add three items: 1. Investigate DFAs. The Aho-Corasick algorithm can be encoded in an array then compressed using techniques described in the Dragon Book in the chapter on Lexing. Frédéric Bour's blog has two posts that provide information. 2. 64-bit Knuth multiplicative hashing seems promising for this kind of hashing. Also called Fibonacci Hashing. 3. Daniel Lemire frequently discusses the use if SIMD, SWAR and AVX instructions to perform parsing.
@narkfly24 күн бұрын
No programmability is definitely the biggest drawback. That combined with closed source software is a hard pass. If it were open source, then the community could come up with a remapping solution. Thanks for such a detailed review - and saving everyone the time and money of learning these lessons the hard way.
@Mfbzai25 күн бұрын
This guy is notice to all developers worldwide to be aware of the new, hugely framework that has been released & came out time by time.
@PeteBrubaker27 күн бұрын
35:30 - I like that style a lot. It really helps when learning unfamiliar code, or when you inherit something and the original author is long gone.
@PeteBrubaker27 күн бұрын
Have you switched to polyglot or tree-sitter for your syntax highlighting yet? It's so worth it.
@RickGladwin27 күн бұрын
The lack of interference with QWERTY muscle memory is fascinating!
@endermaster0828 күн бұрын
WHY ARE THEY CAKED UP IN THE THUMBNAIL??
@D-V-O-R-A-KАй бұрын
`str1[0]==str2[0] && strcmp/memcmp/...(str1, str2)` seems a bit suboptimal. Why not simply inline strcmp or use an implementation of strcmp that starts at [1]?
@j.r.r.tolkien8724Ай бұрын
Abstraction should be the last resort for any good developer. But "Good" is not the word describe anything frameworkers do nowadays.
@j.r.r.tolkien8724Ай бұрын
That's literally what I said and everyone got so mad at me as if I said the most egregious thing ever lol.
@neoedmundАй бұрын
2 mist. how can binary search slower than linear search ? your benchmark is based on your specified data , not general data . right ?
@nicholastoo858Ай бұрын
Why didn't they use common keyboard layout? So that people don't need to re-learn.
@christianjungen4867Ай бұрын
No way, binary search is slower than linear search. Binary search needs significant less compares. For example a list of 1024 entries would need up to 1024 compares, whereas binary search needs no more than 10 compares (log(1024)/log(2))
@ratsalad34624 күн бұрын
Not all memory accesses are equal. Sequential search of a small(ish) table will always be faster than binary search, particularly if the table is layed out sequentially in memory.
@nomorecensorАй бұрын
Hi Gilphoyle😊
@realspinelle1Ай бұрын
Do it again
@pedrofam8302Ай бұрын
Hello, thank you so much for your vids. How does Chromium apply this pattern inter process. I thought each tab was a process by it self in Chrome
@calebhoff3506Ай бұрын
i loved this video & would totally watch a node vs deno one
@another212shadowАй бұрын
angle brackets are for system headers. why aren't you using quotes instead?
@vNCAwizardАй бұрын
It seems important to me that this video should also address the time to construct the hash table in the first place. Both times, construction time and usage time, should be considered when analysing software execution time performance.
@SleeppingForestАй бұрын
where link example code my perfect hash table 338.1 M/s , i am not found
@coreybrennerАй бұрын
Sager's Perfect Minimal Hash paper is illuminating. If you have a fixed set of data, like a keyword set, O(1) can be yours. 😊
@coreybrennerАй бұрын
One collection type I enjoyed figuring out and implementing was the Patricia trie. Structured like a binary tree, but fast descent using your key as the comparison standard (therefore hot in the cache). At the end of the descent, is the only string comparison.
@mrhoxellАй бұрын
The funny part is that understanding the "best tool" part isn't that straight forward (I guess). For me it's more like is "best" when I can solve the problem with it fast and does the right thing. Like it's not just about focusing on the problem but also the things around it - usage proficiency, adaptation to problem, performance concerns, etc. So for me if "something is the best" then it considers the whole spectrum of stuff to be made - not just an ego pick but a thoughtful one that has flaws though seems as "the best" to be used in certain scenario.
@nathanwailesАй бұрын
excellent review
@unimatrixz3ro226Ай бұрын
what a good video, I hope i see more content of you soon