Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
Performance is a subset of Optimization: performance is the goal when you want the execution time of your program or routine to be optimal.
3
votes
Find the uncommon elements from two sets
This should work faster:
private void findUnCommon{
Set<Integer> a = new HashSet<>(Arrays.asList(1, 2, 3, 4));
Set<Integer> b = new HashSet<>(Arrays.asList(3, 4, 5, 6));
Set<Integer> re …
1
vote
Optimize Conway's Game of Life
instead of universeDoubleBuffer[someIndex] use 2 separate fields and 2 separate local variables, swapping values of local variables each step of the loop. Thus one expensive array access operation is …
0
votes
Unbounded, High-performance(?), Generic, Thread-Safe(?), BatchedCircularQueue
You did not say how many messages per second your buffer can pass through itself (and did not provide test code to run), but high performance counts in millions, and I doubt your buffer can give even 1 … Main performance loss is copying data in get(). It takes time to allocate, copy, and deallocate arrays. …
0
votes
Approximating sines and cosines using up to five terms of the Taylor series
cos(X) = sum (Cn) where Cn=x^2n/2n!
sin(X) = sum (Sn) where Sn=x^(2+1)n/(2n+1)!
So, Sn=Cn*x/(2n+1)
Cn=S(n-1)*x/2n
Start from C0=1 and compute S0=C0*x, C1=S0*x/2, S1=C1*x/3 etc.