Possible Duplicates:
C/C++: Detecting superfluous #includes?
How should I detect unnecessary #include files in a large C++ project?
Hi,
I've been following numerous discussions about how to reduce the build time for C/C++ projects. Usually, a good optimization is to get rid of #include statements by using forward declaration...
I'm building a list of hashes that represent root to node paths in a tree. My functions work but they are incredibly slow over large tree structures - is there a better way? I've tried building the list in one function but I get unique hashes where I don't want them.
public ArrayList<Integer> makePathList(AbstractTree<String> tree){
...
UPDATE: I found a solution. See my Answer below.
My Question
How can I optimize this query to minimize my downtime? I need to update over 50 schemas with the number of tickets ranging from 100,000 to 2 million. Is it advisable to attempt to set all fields in tickets_extra at the same time? I feel that there is a solution here that I'm ...
I track a lot of parameters on my Server and the only thing I can't realy put in perspective is the IOstat. It is a MySQL Server, is this a good result, or should I worry?
root:/var/lib/mysql# iostat -xc
Linux 2.6.28-11-server () 07/25/2009 _x86_64_ (8 CPU)
avg-cpu: %user %nice %system %iowait %steal %idle
...
I have the following Java code to fetch the entire contents of an HTML page at a given URL. Can this be done in a more efficient way? Any improvements are welcome.
public static String getHTML(final String url) throws IOException {
if (url == null || url.length() == 0) {
throw new IllegalArgumentException("url cannot be null or empty...
Following are the two ways of calling an image in your webb application.
<img src="/myapp/img/world.gif" />
OR
<img src="http://www.example.com/myapp/img/world.gif" />
Which will be best to use or both have the same meaning. If both do not have the same meaning then why? and is there any performance constraints if I use the second ...
Good Day!
I'm trying to see if there is any way to accomplish this.
I've got a set of items, with associated attributes (Weight, Length, Width).
I've also got a set of Packaging Types, with associated attributes (Max Weight, Length, Width)
I'm looking for an algorithm to determine the LEAST amount of boxes to package the items into.
...
Following is the code to create a table in mysql database.
CREATE TABLE IF NOT EXISTS `hightraffic` (
`id` int(11) NOT NULL auto_increment,
`videoID` int(11) NOT NULL default '0',
`userid` int(11) NOT NULL,
`name` varchar(255) NOT NULL default '',
`title` int(11) NOT NULL default '0',
`date` datetime NOT NULL default '0000-0...
I've written a little function to take a url, and resize the image and store it on my local, however the script is taking about .85 seconds to run when it needs to create the folder, and .64 seconds on a resize. I currently have JPEG and PNG supported as seen below.
I'm wondering if there is a quicker method or something I'm doing that...
This is a question that arose mostly of pure curiosity (and killing some time). I'm asking specifically about Java for the sake of concreteness.
What happens, in memory, if I concatenate a string (any string) with an empty string, e.g.:
String s = "any old string";
s += "";
I know that afterward, the contents of s will still be "any ...
I'm fairly new to programming and I was wondering; What are the best ways to time and optimize my code? The code I'm currently wanting to time is a series of queries in VBA for MS-Access, but I would also like to time code in VB.NET and ASP.NET as well.
So to reiterate, what is the best way to time code and optimize it for each languag...
I am building a view in SQL Server 2000 (and 2005) and I've noticed that the order of the join statements greatly affects the execution plan and speed of the query.
select sr.WTSASessionRangeID,
-- bunch of other columns
from WTSAVW_UserSessionRange us
inner join WTSA_SessionRange sr on sr.WTSASessionRangeID = us.WTSASessionRang...
Hi,
I have a LINQ query which is fetching a list of nested objects.
from c in ClientsRepository.LoadAll()
orderby c.Name
select new ComboBoxOptionGroup
{
Text = c.Name,
Options = from p in c.Projects
orderby p.Name
select new ComboBoxOption
{
Text = p.Name,
...
What tools and techniques are available for optimizing the working set for a large Windows application? There used to be tools like WST and SWS, but they appear to be deprecated. We think we can get runtime performance improvements by moving or removing less used code and resources, thereby optimizing the working set for our program.
...
How does the work_mem option in Postgres work? Here's the description from http://www.postgresql.org/docs/8.4/static/runtime-config-resource.html:
Specifies the amount of memory to be used by internal
sort operations and hash tables before switching to
temporary disk files. The value defaults to one megabyte
(1MB). Note that for a com...
According to the MySQL documentation regarding Optimizing Queries With Explain:
* ALL: A full table scan is done for each combination of rows from the previous tables. This is normally not good if the table is the first table not marked const, and usually very bad in all other cases. Normally, you can avoid ALL by adding indexes that ...
I have created an application that does the following:
Make some calculations, write calculated data to a file - repeat for 500,000 times (over all, write 500,000 files one after the other) - repeat 2 more times (over all, 1.5 mil files were written).
Read data from a file, make some intense calculations with the data from the file - r...
i just noticed that this game (on psp) is roughly around 500MB on a disk image
and i was wondering how capcom made it so.
i mean there were around 300 variations of weapons for their sword types Greatswords and Longswords alone
plus there are other weapon classes (lance,bows,guns) as well that would make the list of weapons go longer......
I am using the following MySQL query in a PHP script on a database that contains over 300,000,000 (yes, three hundred million) rows. I know that it is extremely resource intensive and it takes ages to run this one query. Does anyone know how I can either optimise the query or get the information in another way that's quicker?
I need to ...
Hey all, I've got a query in need of optimizing. It works but its a dog, performance wise.
It reads like this:
SELECT *
FROM (
SELECT *
FROM views
WHERE user_id = '1'
ORDER BY
page DESC
) v
GROUP BY
v.session
I'm tracking views to different pages, and I want to...