Tag: r

53 votes
7 answers
1.5K views
What is exactly the base pointer and stack pointer? To what do they point?

Using this example coming from wikipedia, in which DrawSquare() calls DrawLine(), (Note that this diagram h

avatar
Jesenia
0 1 0 9
asked 07 September, 2021
49 votes
12 answers
1.4K views
Is 'switch' faster than 'if'?

Is a switch statement actually faster than an if statement? I ran the code below on Visual Studio 2010's

avatar
Renaldo
0 1 0 9
asked 07 September, 2021
50 votes
3 answers
1.7K views
What is a retpoline and how does it work?

In order to mitigate against kernel or cross-process memory disclosure (the Spectre attack), the Linux kernel1

avatar
Gigi
0 1 0 9
asked 07 September, 2021
54 votes
10 answers
1.6K views
What does multicore assembly language look like?

Once upon a time, to write x86 assembler, for example, you would have instructions stating "load the EDX regis

avatar
Trudy
0 1 0 9
asked 07 September, 2021
65 votes
4 answers
2.2K views
How to run a program without an operating system?

How do you run a program all by itself without an operating system running? Can you create assembly programs t

avatar
Georgie
0 1 0 9
asked 07 September, 2021
63 votes
5 answers
1.7K views
Why does Java switch on contiguous ints appear to run faster with added cases?

I am working on some Java code which needs to be highly optimized as it will run in hot functions that are inv

avatar
Kristopher
0 1 0 9
asked 07 September, 2021
52 votes
4 answers
660 views
How do I achieve the theoretical maximum of 4 FLOPs per cycle?

How can the theoretical peak performance of 4 floating point operations (double precision) per cycle be achiev

avatar
Dorian
0 1 0 9
asked 07 September, 2021
58 votes
11 answers
1.9K views
Why does C++ code for testing the Collatz conjecture run faster than hand-written assembly?

I wrote these two solutions for Project Euler Q14, in assembly and in C++. They implement identical brute forc

avatar
Deedee
0 1 0 9
asked 07 September, 2021
64 votes
11 answers
1.9K views
Replacing a 32-bit loop counter with 64-bit introduces crazy performance deviations with _mm_popcnt_u64 on Intel CPUs

I was looking for the fastest way to popcount large arrays of data. I encountered a very weird effect: Changin

avatar
Daniel
0 1 0 9
asked 07 September, 2021
62 votes
14 answers
655 views
Is < faster than <=?

Is if (a < 901) faster than if (a <= 900)? Not exactly as in this simple example, but there are slight p

avatar
Trudy
0 1 0 9
asked 07 September, 2021
58 votes
12 answers
924 views
Why doesn&apos;t GCC optimize a*a*a*a*a*a to (a*a*a)*(a*a*a)?

I am doing some numerical optimization on a scientific application. One thing I noticed is that GCC will optim

avatar
Venice
0 1 0 9
asked 07 September, 2021
63 votes
15 answers
2.6K views
Android Studio Collapse definitions and methods

How can I collapse all definitions and methods within the Android Studio editor? Visual Studio has that optio

avatar
Ali
0 1 0 9
asked 07 September, 2021
68 votes
3 answers
3K views
Can I hex edit a file in Visual Studio?

I want to edit a binary file, but I don't want to use another tool other than Visual Studio because it&ap

avatar
Solomon
0 1 0 9
asked 07 September, 2021
56 votes
14 answers
987 views
How to paste in a new line with vim?

I often have to paste some stuff on a new line in vim. What I usually do is: o<Esc>p Which inserts a

avatar
Arline
0 1 0 9
asked 07 September, 2021
53 votes
30 answers
1.9K views
How do I duplicate a whole line in Emacs?

I saw this same question for VIM and it has been something that I myself wanted to know how to do for Emacs. I

avatar
Bryan
0 1 0 9
asked 07 September, 2021
54 votes
13 answers
2.3K views
How can I maximize the editor pane in IntelliJ IDEA?

In Eclipse, I can type Ctrl+M or click the maximize icon in the editor pane to make the editor pane take up th

avatar
Nereida
0 1 0 9
asked 07 September, 2021
63 votes
6 answers
773 views
Delete text in between HTML tags in vim?

I know di< will delete in an HTML tag itself. Is there an easy way to delete text in between two tags?

avatar
Basil
0 1 0 9
asked 07 September, 2021
65 votes
6 answers
982 views
Saving vim macros

Does anyone know how to properly save/reuse macros recorded inside of a vim editor?

avatar
Shantay
0 1 0 9
asked 07 September, 2021
54 votes
2 answers
455 views
How to disable word-wrap in Xcode 4 editor?

I can't find how to disable word-wrap in Xcode 4 editor. How can I do it?

avatar
Gigi
0 1 0 9
asked 07 September, 2021
63 votes
13 answers
2.6K views
How to comment out a block of Python code in Vim

I was wondering if there was any key mapping in Vim to allow me to indent certain lines of code (whether those

avatar
Luis
0 1 0 9
asked 07 September, 2021