Ludovic 'Archivist'
I think it does shit when it comes to cache management
Anonymous
Can you provide a example code?
Ludovic 'Archivist'
and that those 60ns are some shitty cache L3 lookups
Ludovic 'Archivist'
Can you provide a example code?
That would be quite hard as the code is not that small and kinda bundled in lots more shit
Ludovic 'Archivist'
and also under NDA
Ludovic 'Archivist'
but well
Ludovic 'Archivist'
it makes me rage
Ludovic 'Archivist'
out of the hotpath, performance is not horrible
Anonymous
Oh ok, I'll try it myself. I already heard of it
Ludovic 'Archivist'
but the hotpath is littered with stuff that should have been optimized away
Ludovic 'Archivist'
It reminds me of that time i could not compile in -O3 in G++ because it changed some initialization orders and borked the hell out of my memory
Ludovic 'Archivist'
had to add some pragmas to put some 3 lines in -O2 when i was compiling in O3 or more
Ludovic 'Archivist'
Conclusion, sometimes compilers do unexpected shit
Ludovic 'Archivist'
Deterministic unexpected shit that is
Anonymous
Yeah, the problem with g++ still exists. If your code is written in a manner which the compiler don't like it gets a memory and performance hell on O3
Ludovic 'Archivist'
It was a very weird bug
Anonymous
Lel
Ludovic 'Archivist'
in O2 valgrind was like: "perfect dude" then on 03 it was like "what the fuck dude? don't you ever initialize stuff?"
Ludovic 'Archivist'
Short long story two instruction were reversed to optimize a potential cache issue (which existed, but i prefer a very consistent and regular cache issue to a crash)
Ludovic 'Archivist'
in short i have at that place a single instruction that L1 cache misses every time and pumps 5ns in
Ludovic 'Archivist'
kinda infuriating but I don't want to add some assembly shit nor an intel specific _mm_prefetch for now
#39424E
Why here assert - "list iterator not dereferencable": int main() { list<string> users; list<string>::iterator iter; users.push_front("one"); users.push_front("two"); string temp; for (iter = users.begin(); iter != users.end(); iter++); { temp = *iter; } return 0; }
olli
Why here assert - "list iterator not dereferencable": int main() { list<string> users; list<string>::iterator iter; users.push_front("one"); users.push_front("two"); string temp; for (iter = users.begin(); iter != users.end(); iter++); { temp = *iter; } return 0; }
you have a semicolon ; after the for loop parenthesis, so the for loop has an empty body. After the loop, inside your {} block you dereference iter, which point past the last element Tip: - variables should use the smallest scope, since iter is only used inside the loop, delcare it as part of the loop. Mistakes like this one would result in a compile error instead of "strange" runtime behavior
Anonymous
#include<iostream> using namespace std; class person{ public : void introduce (){ cout <<"hi from person"<<endl; } }; class student : public person{ public : void introduce (){ cout <<"hi from student"<<endl; } }; class Farmer : public person{ public : void introduce (){ cout <<"hi from farmer"<<endl; } }; void whosThis(person &p){ p.introduce(); } int main() { Farmer anil; student alex; whosThis(alex); return 0; }
Anonymous
Only the main class is calling
Anonymous
Base class is calling but derived class is not calling
Anonymous
Why
Dima
add override keyword
Anonymous
add override keyword
I don't understand what you said
Dima
you should
Mat
I don't understand what you said
Search what a key word is and what override does
Mat
You'll understand
Anonymous
"Virtual "
Anonymous
Mat
Is it right
It's spelled correctly, yeah
Anonymous
Thanks for the help
mesfin
Hi everyone
Sudheesh
Hi
Sudheesh
Thank you
Barney
hi
klimi
hi
Hi
Barney
I want to learn progrraming languages
Ludovic 'Archivist'
I want to learn progrraming languages
Too bad, people can only teach you kneating here
Ludovic 'Archivist'
Jk
Dima
kek
Arun
Hie
Aasir
K
Anonymous
Hi
Anonymous
Welcome
Anonymous
Hello the rules are awesome!
Dima
welcome!
Anonymous
Could you help me please what is my mistake
Anonymous
It stops working after printing data items in original order part
Mihail
Segmentation fault?
Anonymous
How ?
Thespartann
Mihail
How does it stop working?
Excalibur
Could you help me please what is my mistake
Most probably the swap fn Replace the code inside it to the bubblesort swap call It may work
Anonymous
It should sort the numbers and print them after this
BinaryByter
dafaq, when does a proxess return -1073741819?
Mihail
Could you help me please what is my mistake
Try moving the swap function outside the scope of the bubbleSort function
Mihail
Mihail
Doesnt work :(
Same thing?
Anonymous
Yes
Anonymous
Could it be about the way I call the function ?
BinaryByter
Ohhh wait
BinaryByter
this is windoze
Mihail
sure?
It's just a random value I think
BinaryByter
that used to be in this ram
Mihail
Mihail
that used to be in this ram
And it's your fault that it still is tbh