I develop a webservice application in a tomcat container, I have a lot of properties for the webapp like constants, error messages and so on.
What is the better and faster way to?
Using jQuery what provides for faster object construction:
With the HTML code
$('<dd class="foo baz" id="bar"> foobar </dd>')
Or with the pure object/method variant
$('</dd>').addClass('foo').addClass('baz').id('bar').text('foobar')
I'm not sure how the internals work, feel free to supply a high level summary.
Hi
I have this kind of request :
SELECT myTable.ID,
myTable.Adress,
-- 20 more columns of all kind of type
FROM myTable
WHERE EXISTS(SELECT * FROM myLink
WHERE myLink.FID = myTable.ID
and myLink.FID2 = 666)
myLink has a lot of rows.
Do you think it's faster to do like this :
SELECT myLink.FID INTO @result
FROM myLink
WHERE myLink.FID2 = 666
UPDATE @result SET Adress = myTable.Adress,
-- 20 more columns of all kind of type
FROM myTable
WHERE myTable.ID = @result.ID
I know WPF is more complex an flexible so could be thought to do more calculations. But since the rendering is done on the GPU, wouldn't it be faster than Winforms for the same application (functionally and visually)?
I mean when you are not running any games or heavy 3d rendering, the GPU isn't doing heavy work, right? Whereas the CPU is always busy.
Is this a valid assumption or is the GPU utilization of WPF a very minor operation in its pipeline?
I'm running a case-insensitive search on a table with 7.2 million rows, and I was wondering if there was any way to make this query any faster?
Currently, it takes approx 11.6 seconds to execute, with just one search parameter, and I'm worried that as soon as I add more than one, this query will become massively slow.
SELECT count(*)
FROM "exif_parse"
WHERE (description ~* 'canon')
is there any faster way to parse a text than by walk each byte of the text?
I wonder if there is any special CPU (x86/x64) instruction for string operation that is used by string library, that somehow used to optimize the parsing routine.
for example instruction like finding a token in a string that could be run by hardware instead of looping each byte until a token is found.
I basicly need to load the whole XML file, add a new line with content and then saving it. But I wondered which one is faster.. XMLWriter or SimpleXML? Oh, and, it's mainly large XML files, more then 10MB.
Thanks!
What is faster: writing PHP code using functions or writing it as pure script? So, as I see it Apache or any other server will create from PHP code using functions a pure script... I mean we had:
function foo($a, $b){ return ($a + $b); echo foo(4, 5)}
and Apache will turn it into something like:
echo (5 + 4)
Or will it?
We are in process of optimization of Flex AS3 Application.
One of my team member suggested us to make varible name length smaller to optimize the application performence.
i.e.
var IsRegionSelected:Boolean = false; //Slower
var IsRS:Boolean = false; //faster
Is it True?
Please provide your views...
Can someone suggest an algorithm that finds all Pythagorean triplets among numbers in a given array? If it's possible, please, suggest an algorithm faster than O(n2).
Pythagorean triplet is a set {a,b,c} such that a2 = b2 + c2. Example: for array [9, 2, 3, 4, 8, 5, 6, 10] the output of the algorithm should be {3, 4, 5} and {6, 8, 10}.
Related:
http://stackoverflow.com/questions/24853/c-what-is-the-difference-between-i-and-i
In C language, Why does n++ execute faster than n=n+1?
(int n=...; n++;)
(int n=...; n=n+1;)
Our instructor asked that question in today's class. (this is not homework)
I have the following questions, please if you know the answers share it with me.
How can I transform my working Java code to NDK? (it's an algoritm not activity)
I am able to access the database from NDK?
Will a backtracking algorithm with 10 millions of iterations run faster if was written with NDK?
is there a faster way then to simply catch an exception like below:
try
{
date = new DateTime(model_.Date.Year, model_.Date.Month, (7 * multiplier) + (7 - dow) + 2);
}
catch (Exception)
{
//This is an invalid date
}
In C language, Why does n++ execute faster than n=n+1?
(int n=...; n++;)
(int n=...; n=n+1;)
Our instructor asked that question in today's class. (this is not homework)
If I have 3 million files, which directory structure is better?
Method 1. ~/123456789.htm
(Putting all the 3 million files into the same folder without any sub folders)
Method 2. ~/789/123456789.htm
(Create 999 sub-folders, each sub-folder contains about 3000 files)
For Windows Server 2008, which structure is faster?
A friend wrote a query with the following condition:
AND ( SELECT count(1) FROM users_alerts_status uas
WHERE uas.alert_id = context_alert.alert_id
AND uas.user_id = 18309
AND uas.status = 'read' ) = 0
Seeing this, I suggested we change it to:
AND NOT EXISTS ( SELECT 1 FROM users_alerts_status uas
WHERE uas.alert_id = context_alert.alert_id
AND uas.user_id = 18309
AND uas.status = 'read' )
But in testing, the first version of the query is consistently between 20 and 30ms faster (we tested after restarting the server). Conceptually, what am I missing?
This is part two of the question: http://stackoverflow.com/questions/2913639/mysql-make-this-query-faster-theres-a-way
this query still run slowly:
SELECT b.id,
b.name,
c.name
FROM bookcorr as a JOIN books as b on b.id = a.books_id =
JOIN Library as c on c.id = a.library_id
WHERE a.category_id = '2521'
AND a.library_id = '4983'
ORDER BY b.name ASC LIMIT 0,15
Any suggest ?
Currently, I've developed android news application for my client. In this project, I've used JSON feed for content sync but I feel rendering JSON feed in android is a bit slow. Perhaps, due to my coding or something else. Now want to try XML feed instead of JSON.
Thus please let me know which type of feed (between XML and JSon.. but let me know any good feed any other else) is faster for rendering in Android?
In the similar query Update on #temp table is faster then the @ table variable.
But I m forced to use table variable as I am wokring with function. I feel index is not being picked up for table variable. I have unique clustered index.
Please help
I need to perform lots of evaluations of the form
X(:,i)' * A * X(:,i) i = 1...n
where X(:,i) is a vector and A is a symmetric matrix. Ostensibly, I can either do this in a loop
for i=1:n
z(i) = X(:,i)' * A * X(:,i)
end
which is slow, or vectorise it as
z = diag(X' * A * X)
which wastes RAM unacceptably when X has a lot of columns. Currently I am compromising on
Y = A * X
for i=1:n
z(i) = Y(:,i)' * X(:,i)
end
which is a little faster/lighter but still seems unsatisfactory.
I was hoping there might be some matlab/scilab idiom or trick to achieve this result more efficiently?
Somebody asked me Is n++ faster than n=n+1?
My answer:--
++ is a unary operator in C which(n++) takes only one machine instruction to execute while n=n+1 takes more than one machine instructions to execute.
Anyone correct me if I am wrong, but in Assembler it take something like this:
n++:
inc n
n = n + 1;
mov ax n
add ax 1
mov n ax
its not exactli this, but it's near it.but in most cases a good compiler will change n = n + 1 to ++n.So A good compiler will generate same code for both and hence the same time to execute.
With my limited experience/knowledge I am using the following structure to generate HTML tables on the fly from MySQL queries:
$c = 0;
$t = count($results);
$table = '<table>';
while ($c < $t) {
$table .= "<tr><td>$results[0]</td><td>$results[1]</td> (etc etc) </tr>";
++$c;
}
$table .= '</table>';
this works, obviously. But for tables with 300+ rows there is a noticeable delay in pageload while the script builds the table. Currently the maximum results list is only about 1,100 rows, and the wait isn't long, but there's clearly a wait.
Are there other methods for outputting an HTML table that are faster than my WHILE loop? (PHP only please...)
Douglas Crockford describes the consequence of Javascript inquiring a node's style. How simply asking for the margin of a div causes the browser to 'reflow' the div in the browser's rendering engine four times.
So that made me wonder, during the initial rendering of a page (or in Crockford's jargon a "web scroll") is it faster to write CSS that defines only the non-zero/non-default values? To provide an example:
div{
margin-left:2px;
}
Than
div{
margin:0 0 0 2px;
}
I know consequence of this 'savings' is insignificant, but I think it is still important to understand how the technologies are implemented. Also, this is not a question about formatting CSS--this is a question about the implementations of browsers rendering CSS.
Reference: http://developer.yahoo.com/yui/theater/video.php?v=crockonjs-4