People don't seem to understand that O(1) is not FASTER than O(n), it just SCALES better; there's a breaking point. Imagine a "hashcode as a service" rest call vs doing it in memory: it'd still scale better, but it'd take an awfully large 'n' to get there. I see people missing this in PRs, streaming/looping an array is often faster with small arrays than something like a `HashSet`. And in practice, its really unlikely either makes a tangible difference in most use cases.
One time, for a hashmap implementation (that i needed to be really fast, faster than the STL hashmap) i created a vector of linked lists as the buckets. HOWEVER, that was fairly slow to both create and delete and the data was spread out, so instead i packed all the linked lists into a single vector, where each element of the vecor is a node of the linked list (KeyHash,Key,Element,Next) And another vector, which keeps the beginning element for each bucket (this one is resized manually when the buckets become too full (>75%) and the other one is resized whenever it decides) This sped up the creation/deletion of the hashmap by a lot and (probably) reduced the cache misses due to all the elements being stored in 2 vectors (the largest that the hashmap got was around 150 million keys, the task was "determinization of finite automata", mathematically solving that task is of the order of 2^n, but i needed a fairly quick solution for a university project)
Linear search to insert on a linked list? Well there is your issue. I sped something up going from a vector to a linked list. Insertion sort (even using a binary search) works until the data becomes too large. Then you use merge sort.
I actually wonder, is this the only time in anime they let Archer do the full chant? I could swear by the time of ufotable's UBW it was already shortened by a few lines.
Thank you for this video. I hope someday we get another fate adaption. May Jesus Christ be with you. John 3:16 "For God so loved the world that he gave his one and only Son, that whoever believes in him shall not perish but have eternal life."
@@thefanwithoutaface8105 He was definitely the best matchup against Herc out of all the servants in the war, except Gilgamesh and maybe Saber (if she had enough mana).
@@n00d13sandr1c3 Yeah but that's the key thing "IF" Saber's Excalibur can hurt him but if it fails to Oneshot him she's doomed as that's basically her only weapon and now he's immune to it.
This is from "GoingNative 2012 - Day 1 - C++11 style" at 0:45:00 if you want the full lecture. ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-m0H5bUPfwn8.html
Can someone please explain how the memory requirements @4:47 were deduced. I am off by a factor of 2 for both the vector and linked lists (I get 0.8MB and 3.2MB). Ex for list: (64x4)/8 * 100,000 = 3.2 MB.
I am the bone of my sword. Steel is my body fire is my blood. I have created over a thousand blades. Unknown to death. Nor known to life. have withstood pain to create many weapons. Yet,those hands will never hold anything. So as i pray. UNLIMITED BLADEWORKS!
*FGO Version* I am the bone of my money Steel is my Saint Quartz and fire is my Bank Account I have created over a thousand 3 stars Unknown to Gaia nor know to Alaya Have Withstood Pain to wish many Artoria Yet those hands will never hold Jeanne D'arc So as I pray, UNLIMITED BUDGET WORKS
Ufotable version: I am the yen of my note Coins are my body, and sponsorship is my blood I have created over a thousand frames Unaware of gain nor aware of loss The bearer lies here drawing frames on a hill alone I have no regrets, this is the only path My entire life has been unlimited budget works!
@@Rifkigtx_YT It wasn't good animation even when it was new, and it's probably not as old as you think it is because it's bad. But yeah I still rewatch this scene over and over again for this epic speech, could barely get through the anime though.
@Slome No, it's because Ufotable just somehow made great animation since 2007 and still improving until now. For a 2005s anime this is actually pretty good. And if you watch this anime today, there's just some weird nostalgic feeling that makes this anime good too
ngl, his english while perform the Unlimited Blade Works chant just keeps getting better and better later on......and Im proud of the VA for making such progress
Do *not* pay attention to this advice if you are developing for CPU(s) without cache. The linked list was invented in 1955-1956, when no CPU had cache. Without CPU cache, a vector shoving each of its elements after the insertion/deletion point over by one location is very costly, and the random memory access itself of the traversal of the linked list incurs no performance hit versus incremental access.
@@RetroDawn I will have to disagree with you on that, most CPUs (at least modern ones not sure about older ones) have many cache layers. Maybe the ones you work on don't but the majority of them certainly have cache
@@ayaanqui Smaller microcontrollers are cacheless, as are many but not all embedded controllers. I use everything from 9S08 (8 bit), 9S12 (16 bit), PIC16, PIC18, ARM, PowerPC. Only the ARM and two of the three PowerPCs I use have caches. There are actually three timing constraints. One is presence or absence of a instruction cache, another is the presence or absence of a data cache, other depends on the memory type. Smaller systems like embedded controllers that are run-in-place (code is in FLASH) often have static RAM so there is a small latency for page changes. Larger RAM has a precharge/rewrite cycle and crossing a boundary incurs a very large delay, often 70ns or more.
The inventors of Simula; Specifically, Kristian Nygaard. He was also part of the inspiration for the original C With Classes that was Bjarne’s project preceding C++