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.
22
votes
3
answers
234k
views
Quickly filter an object by keys
I feel that creating a new object each time may degrade performance. Is there a way to mock the Array.prototype.filter function for objects? …
1
vote
1
answer
151
views
Optimize "nearest" Element query prototype
I have devised a recursive function to grab the "nearest" element. This is a bit different than Element.closest, because instead of traversing just the immediate parent(s); it traverses up but checks …
5
votes
3
answers
5k
views
Compute bounding rectangle given 2 points quickly and efficiently
Is there a faster way to compute the bounding area between 2 points?
// Minified Version
public static Rectangle computeBounds(Point2D.Double p1, Point2D.Double p2) {
double dx = p2.x - p1.x, dy …
3
votes
1
answer
154
views
Optimize CSS Rule Dumper
I have written the following Tampermonkey/Greasemonkey script. I am trying to obtain a list of all CSS rules for a page; across all stylesheets. As of now, I am just iterating over everything. Is ther …
2
votes
1
answer
743
views
Traverse a list of tree nodes
I am wondering if there is a better way to traverse a list of trees.
Here is my current algorithm:
Collect the parent IDs in a Map
Traverse all the groups and find ones where their ID is not in the m …
1
vote
1
answer
1k
views
Pixel bit-wise LSB extraction to byte array
I wrote the following code below to extract the least significant bit (LSB) of each pixel and store it into a byte[] array. I was wondering if Java has a more efficient way to do this?
Right now, I a …