performance

Quickest way to write logging/stats data - file, database or url to external service

Hi, I am running a high volume web service and want to track the number of times the service gets called (per customer). However, I want the logging/writing of this data to have minimal impact on the overall time taken to process the service request. I have thought of three ways: Write to file (would need to open the file, read the 'h...

expires headers? How do I implement them and what are they?

I am using jquery. I have tried searching how to implement them but it makes no sense to me. It talks about apache and Django and Lighttpd, but I have no idea what those are. I used ySlow on my webpage and it told me I need an expires header.. Apparently it really helps with performance though and that's what I really need. Anyone help...

Upload one large file once, and change its scale using css, or use different files of the same image in different sizes?

I have a little book flipping site. I have it so I upload an image (the page), the size is about 1500x1948, but it is scaled down using css to fit on the ipad better (it becomes about 946x728). Then I have it so if you double click the image, it scales into its original size (1500x1948) and you can scroll around the page. Is it better t...

automated measurement of browser-side performance times

We are doing a series of client-side performance tests for a large website and we primarily use Fiddler and DynaTrace for our measurements. But we've run into 2 major issues: The clients are intent on measuring the asynchronous part of the page load (Stuff that gets kicked in after document.ready). Using fiddler, its hard to tell which...

Web site performance - what is it about? Readability and ignorance Vs. Performance

Let me cut to the chase... On one hand, many of the programming advices given (here and on other places) emphasize the notion that code should always be as readable and as clear as possible, at (almost?!) any pefromance cost. On the other hand there are SO many slow web sites (at least one of whom, I know from personal experience). Obvio...

overhead in addressing 2d array in linear memory space

Does addressing addressing values in a multidimensional array in a linear fashion as in values[row_num*row_width + column_num] incur extra computation for the multiplication/addition when compared to values[row][col]? Or does the compiler convert the latter to the former anyway? ...

asp.net: avoid too many queries repeatedly to database

Hi, Among methods: static variables, viewstate, session and cache for avoiding on loading repeatedly and less making queries to the database. What do you think the best method of the 4 above? I Think Cache is the best one? Or any other methods better in Asp.net 3.5 or higher? Please advise me on this. Thanks in advance ...

For insert-performance consideration, should a clustered index on a timestamp be ascending or descending?

I just realized I have a clustered index on a Timestamp in descending order. I'm thinking about switching it to ascending, so that as new, ever-increasing timestamps are inserted, they are added to the end of the table. As it stands now, I suspect it has to add rows to the beginning of the table, and I wonder how SQL Server handles tha...

Linq paging - how to solve performance problem?

Edit: Entity Framework seems to be the issue, discussed further in question Entity Framework & Linq performance problem. I am supporting a PagedList (using linq/generics) class written by someone long departed - and it has 2 lines that have very bad performance - on a dataset of just 2 thousand rows it takes up to one minute to run. Th...

PHP: list number of times a word was found?

I got a custom log, roughly 29MBs of user's data, including user agent. I want to parse through it (essentially just search) and find how many occurances of say, "Firefox" or "MSIE" appear in it, like a mini log parser. This is where I am stumped.. What I was getting at is explode()ing newlines, and iterate through the array, use: if ...

SQL queries exceedingly slow when referencing primary key

I have a MS SQL table with about 8 million records. There is a primary key (with clustered index with only 0.8% fragmentation) on the column "ID". When I run seemingly any query referencing the ID column, the query takes very long (and in fact ultimately crashes my application). This includes simple queries like "SELECT * FROM table WH...

Entity Framework & Linq performance problem

I have a performance problem with Entity Framework and Linq, when paging a list of Product objects: var data =_service.GetAll(); var page = data.Skip((index) * pageSize).Take(pageSize); list.Add(page.AsEnumerable); // ** its slow right here There are 1958 products in my test database, but when the above code runs I can see 3916 (that...

How to efficiently remove all rows from a table in DB2

I have a table that has something like half a million rows and I'd like to remove all rows. If I do simple delete from tbl, the transaction log fills up. I don't care about transactions this case, I do not want to rollback in any case. I could delete rows in many transactions, but are there any better ways to this? How to efficiently r...

inner join Vs Function

Hi all, Which of the following query is better... This is just an example, there are numerous situations, where I want the user name to be displayed instead of UserID Select EmailDate, B.EmployeeName as [UserName], EmailSubject from Trn_Misc_Email as A inner join Mst_Users as B on A.CreatedUserID = B.EmployeeLog...

in Postgresql how to speed up substring queries

I have a simple logs table with about 500,000 rows, table structure is TABLE logs ( id serial NOT NULL, username character varying(32), user_id integer, description text NOT NULL, "time" timestamp with time zone DEFAULT now(), referrer character varying(128), "type" character varying(25) ) The most common operation in t...

Performance testing using FlexUnit

FlexUnit is quite an impressive framework for testing and with the new integration in Flash Builder 4 it's a no brainer to use it. However, I'm not sure why it's necessarily exclusive to just unit testing. In my opinion, I think the tools are great candidates for performance testing as well. It should also be mentioned that by performan...

is php sort better than mysql "order by" ?

Hi. I was wondering if, in terms of performance and considering a mysql select on a table with very very very many (> 1.000.000) records, is better sorting results with sql "order by" or sorting results after the query with classical programming sort algorithm ... someone has any suggestion? Tanks ...

Reusing Lucene Query objects

Are Lucene's Query objects reusable/stateless ? If not, will clone()ing a TermQuery be faster than rebuilding it ? ...

Variation in performance when using GetDirectories

I have a production performance issue that I'm stumped on. I'm hoping that someone has seen something similar or at least has a few troubleshooting techniques. I support an inherited asp.net web application that retrieves files from a shared network drive. One particular folder [we'll call it FOLDERA] I've chosen to troubleshoot again...

Is there significant overhead for PRINT statements in SQL Server 2005 Stored Procedures?

I noticed in a code review that one developer added PRINT statements throughout many SQL Server stored procedures. These stored procedures are executed from a ASP.NET website, using SqlClient. Is there any performance penalty to having these PRINT statement in the code? Or will they automatically be skipped when the procs are called fr...