For example I have 3 calls of one method (always 3 calls) and I need to pass 1 to method for the first call 2 for the second and 3 for the third. I can solve that Problem in 2 ways. Either make 3 calls with 1, 2, 3 or use a for loop.  call(1); call(2); call(3);  for (int i = 1; i &lt;= 3; i++) {     call(i); }   The question is what will run faster. As I know this depends completly on the Java Compiler, because it could make optimizations on the for loop.  In plain C the redundant way would be a little bit faster I guess, because there is no counter needed to increment and compare.
How do you write (and run) a correct micro-benchmark in Java?  I'm looking for some code samples and comments illustrating various things to think about.  Example: Should the benchmark measure time/iteration or iterations/time, and why?  Related:
Will there be data loss if I upgrade? Adding multiple CKEditor instances in jquery How to fill down in Numbers without dragging? Is there a c# equivalent of Java ConcurrentHashMap Where do the bipolar jets of black holes come from? How are they formed? And why are they so bright? Do the topologies with the same convergent sequences coincide? Do the same sequential convergence in two topologies the result are the same topologies? Let $X$ be topological  space with topologies $\tau$, $\tau'$. Let $(x_{n})\in X$ and $x\in X$ and $(x_{n})\rightarrow x$ with $\tau$ if and only if $(x_{n})\rightarrow x$ with $\tau'$. Do the two topologies on $X$ coincide? Prove that $\overline {A^\complement} = (A°)^\complement $   To show that $\overline {A^\complement} \subseteq  (A°)^\complement$   We first show $A^\complement \subseteq  (A°)^\complement ...(*) $  We know that since $ A°\subseteq A \qquad (*)$ is automatically follows .  The part I didn't understand is the following:     Then we conclude that since $ (A°)^\complement$ is closed    $\therefore \overline {A^\complement} \subseteq  (A°)^\complement$ number of vertices in a self-complemntary graph Problem: Prove that the number of vertices of a self-complementary graph must be congruent to 0 or 1 modulo 4. I think my starting point would be that P4 and C5 are self-complementary and proceed by induction by adding P4s. I established the first step in a previous problem, but I need help on the induction step. i.e. proving that adjoining P4 will indeed yield a self-complementary graph. LibreOffice Calc - Disable rounding There are a  on this topic, but no simple and definitive answers.    Can someone please tell me how to permanently disable cell rounding on the .csv file which is created by script?  Basically, '377635637222436751' is being converted to '377635637222437000' automatically and that isn't really acceptable for my needs.  I've tried this: Tools->Options->Calc->Calculate "Precision as shown"   and this: Format > Cells > Numbers > Category > (scroll down for) Text. (but considering my script creates the .csv -- this option isn't very good since it must be done after the file is created)  And neither is working.  The number stays rounded -- even after formatting the column after the file is created.  Does anyone have any suggestions? Short story about a group of sci-fi writers sitting around discussing their profession Is there a way to merge to two bars in GNOME 3? Best case scenario would be to have one single bottom or top bar that has all the symbols on the left side and the rest like the time indicator, connections, on/off button, etc. on the right side.  Is that possible in any way? Blank screen after installing nvidia restricted driver I've  and rebooted my machine and now I get a black or blank screen.   How can I fix this? Why is disk usage greater than the size of all files on it? Server vs single-player world effects Are there any differences with regards to chunk generation or other settings in single-player vs server mode of equivalent versions?  I have a map I'd like to host on a private server for my friend to play with me. However, when I'm on the road without ready internet, I'd like to play it single-player as well.  Will this cause any issues, especially with chunk generation, drops, items, etc (i.e., getting a different chunk generated in server-mode than single-player would have created), or do all server-client version pairs (I'm using 1.6.2) use the same game code?  The main point is that I don't want gameplay to change at all, between single-player and server mode. Is it legal to study while on a tourist Schengen visa? If, say, you acquired a 90-day tourist Schengen visa, would it be legal to use it for the purpose of visiting a language course or a university class? Or do you have to apply for a special education visa if you have such intents?  Answers linking to official EU pages on that matter would be highly appreciated :) How to Deserialize XML document How to force the Y axis to only use integers in Matplotlib? iOS 11-13 - unable to paste into comments How can swapoff be that slow? Somehow I happened to swap out 14 GB of memory. After having killed the culprit, I have tons of free memory again, so I thought I could  again. So with 5 GB out of 32 GB used and 14 GB of swap space used, I ran swapoff -a.... and 4 hours later about half of the work was finished.  This means less that 1 MB/s, while I can easily copy 200 MB/s. My swap is encrypted but so are all normal partitions and with  it leads to no noticeable CPU load (and filling the swap space took only a few minutes). I see that there's no special reason to optimize swapoff, however I wonder how it could get that slow?    Just adding some more data: My main memory is 32 GB and I have 32 GB swap space on each of 4 harddisks (surely an overkill, but who cares?). The whole swap space can be  (decrypted and) read in less than 5 minutes:  time -p sudo sh -c 'for i in /dev/mapper/cryptswap?; do md5sum $i &amp; done; wait' 014a2b7ef300e11094134785e1d882af  /dev/mapper/cryptswap1 a6d8ef09203c1d8d459109ff93b6627c  /dev/mapper/cryptswap4 05aff81f8d276ddf07cf26619726a405  /dev/mapper/cryptswap3 e7f606449327b9a016e88d46049c0c9a  /dev/mapper/cryptswap2 real 264.27   Reading a part of a partition can't be slower than reading it all. Yet reading about 1/10th of it takes about 100 times longer.  I observed that during swapoff both the CPU was mostly idle (maybe 10% of one core) and so were the disks ("measured" by the LEDs). I also saw that the swap spaces were turned off one after the other. Facebook changed how their API serves profile pictures that are requested with a non-application scope UID. Now because before Graph API 2 all applications shared the original UID, if users like me has joined Stack Exchange websites before  2, rolling out their profile pictures are not shown properly. Facebook suggests to use an access token to query those profile pictures, either an application access token or a user access token. A user access token is not a reliable option at all, because it would only work for users who joined website with Facebook and are currently logged in. Application access tokens, by the way, can be used by creating sort of a proxy that would retrieve a profile picture from Facebook and display it. Yet still it's not perfect. I think the best solution is to communicate with Facebook and ask them to offer an opportunity to convert old Graph API 1 UID's to application scope user IDs.