strager please come back man wtf, Twitch coding section is shit...you have alcoholic webdevs pretending to know how to code, people using "Godot" claiming to be devs, an some shitty sysops giving lessons.....we need you man
strager, are you still streaming? Don't know if you read these. Found the streams probably the most informative on Twitch, and the programming community that came with it probably the best on twitch. Book club was the best. I hope you will stream again, as most programming streams on Twitch are stupid web devs pretending to know how to code (except for Tsoding ).
0:10: You *_GET IT WRONG_* already in the first 10 seconds! Hash table is an implementation method, dictionary is any data structure where you can look up items based on something else than an integer index. A dictionary or as it is often called: an associative array, is not a hash table. It could be implemented by a hash table, but it could as well be implemented by a balanced tree, a heap (in sorting meaning) or a B-tree.
omg that ending. Thanks for saving me +100 usd and 3 months of stress. It's kind of ridiculous, I am a programmer too, and I have the feeling that such kind of keyboards attrakt mostly programmers. Why would they not think about symbols!!! needing to use 3 fingers for a single symbol character is insane.
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
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
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.
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
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).
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
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.
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.
Let's try this a third time. I cannot believe that I cannot leave a comment on a video. Does nothing work nowadays? Maybe RU-vid 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.
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.
`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]?