Showing posts with label Performance. Show all posts
Showing posts with label Performance. Show all posts

Tuesday, 26 April 2016

JetBrains dotMemory not attaching = reload .NET perf counters

If you get an issue using dotMemory where it wont connect to the profiler, then run the following two commands from a .net command prompt…
unlodctr .NETFramework
lodctr C:\Windows\Inf\.NETFramework\corperfmonsymbols.ini

Wednesday, 11 February 2015

Resharper running slowly

Just found a neat trick for speeding up the Ctrl+T navigation slowness against my solution with JetBrains Resharper 8.2

1. Clean out your cache folder for the solution...

%userprofile%\AppData\Local\JetBrains\ReSharper\v8.2\SolutionCaches

2. Resinstall Resharper

Wednesday, 13 August 2014

Hyperlinks not opening immediately from emails

If this happens then follow the steps below to fix it...

To reset Internet Explorer Settings, follow these steps:

  1. Close all Internet Explorer windows.
  2. Click Start, type inetcpl.cpl in the Search box and then click inetcpl.cpl on the Programs list.
    The Internet Options dialog box appears.

     

    Note for Windows XP, click Start, click Run, type inetcpl.cpl in the Open box, and then click OK.

  3. Click the Advanced tab.
  4. Under Reset Internet Explorer Settings, click Reset. Then, click Reset again.
  5. When Internet Explorer finishes resetting, click Close in the Reset Internet Explorer Settings dialog box.
  6. Start Internet Explorer again.
    Your changes will take effect the next time that you open Internet Explorer.


Monday, 20 January 2014

SQL Server version checking

SELECT @@version

then compare your result against this list

http://sqlserverbuilds.blogspot.co.uk/

P.S. Pagination in a sub report works only in SQL 2008 R2 versions and above, but only if there is only one column in the Tablix of the master report.

Wednesday, 18 December 2013

SQL Server Report Server Investigations

The following SQL will let you find the worst performing reports, and also the ones that error on your reporting services database instance.


SELECT C.Path,
    C.Name

          , E.Requesttype
           --WHEN 1 THEN 'Subscription'
           --WHEN 0 THEN 'Report Launch'
           --ELSE ''
           --END
          ,E.TimeStart
          ,E.TimeProcessing
          ,E.TimeRendering
          ,E.TimeEnd
          ,[TimeTotal (ms)] = DATEDIFF ( millisecond , E.TimeStart , E.TimeEnd )
          ,E.Status
          ,E.InstanceName
          ,E.UserName
     FROM Reportserver.dbo.ExecutionLog E (NOLOCK)
     INNER JOIN Reportserver.dbo.Catalog C (NOLOCK)
       ON E.ReportID = C.ItemID
WHERE 1=1
--    WHERE C.Name = 'Project Full Control Comments'
and E.Requesttype = 0
and E.Status <> 'rsSuccess'

ORDER BY [TimeTotal (ms)] DESC

Wednesday, 18 September 2013

Preload Images with CSS, Javascript or Ajax

See here for many ways to achieve this...

http://perishablepress.com/3-ways-preload-images-css-javascript-ajax/

Personally I'm sticking with the following...

http://jsfiddle.net/chafferm/VU2dq/

Note the type check for array in this example is probably overkill, as it is for all browser versions, we could have used jQuery isArray instead, or even Array.isArray in ECMA script 5 (IE 9 or higher).

Monday, 25 March 2013

Windows 7 Performance Boosting

20 Amazing Windows 7 Performance Boosting Tips In Under 10 Minutes!

Note: If you use the search facility in MS outlook, then ignore the step about disabling windows search service...

http://www.pcmtechhelp.com/2011/07/16/20-amazing-windows-7-performance-boosting-tips-in-under-10-minutes/

Friday, 15 March 2013

Logical fragmentation in SQL Server Indexes

My colleague Lawrence today discovered that a query we had that was taking over 2hrs to run (and still timing out), was due to a non clustered index being badly fragmented on the table in question.

To discover this fact he used the following queries, before rebuilding all indexes on the table, which then fixed the issue, and got the query coming back in 2 seconds.

--1. find index names
sp_helpindex 'dbo.MyTableName'

--2. show index logical fragmentation. Scan density should be above 97%
dbcc showcontig (MyTableName) WITH TABLERESULTS, ALL_INDEXES

--3. show when indexes were last rebuilt
Declare @dbid int
Select @dbid = db_id('Beacon')
Select objectname=object_name(i.object_id)
, indexname=i.name, i.index_id
, o.create_date, o.modify_date
from sys.indexes i, sys.objects o
where objectproperty(o.object_id,'IsUserTable') = 1
--and i.index_id NOT IN
--(select s.index_id
--from sys.dm_db_index_usage_stats s
--where s.object_id=i.object_id and
--i.index_id=s.index_id and
--database_id = @dbid )
and o.object_id = i.object_id
and object_name(i.object_id)= 'MyTableName'
order by o.modify_date desc

Monday, 4 February 2013

BT Tampering with Epsom cabinet 53

Broadband from £5.99 a month with an included wireless router when you sign up to Plusnet - terms apply
It appears that the only people able to receive a fibre optic connection to the Epsom exchange on our estate are BT infinity customers. I've contacted my neighbours (all of whom registered interest around the same time on the http://bt.com/infinity web site), and it appears only those that are BT broadband customers were sent the "Fibre is now available email".
What's more strange is what appears to have happened with our cabinet (number 53). See below for pictures showing the old cabinet 53 that is now connected to a brand new shiny fibre cabinet, and you can clearly see the road having been dug up where the cable is lying that connects the old cabinet to the new one...
NOTE: CLICK ON THE PICTURES BELOW TO SEE FULL VERSIONS OF THEM
Cabinet 53 which serves all houses on our estate.
image
Cabinet 53 with road way dug up to connect new cabinet (see next picture)
image
New fibre cabinet
image
Note how the only people in our area reporting fibre optic speeds (i.e. greater than 8MB speed) are BT customers exclusively!
NOTE: CLICK ON THE PICTURE TO SEE THE FULL VERSION
clip_image002
The only address that now lists as being able to receive broadband on our estate is the following one... (although somehow they're connected to cabinet 43).
clip_image002[6]
clip_image002[8]
What's even more strange is that customers that already have fibre connection with BT infinity are told that they can't have it, if they search using their postcode and house number (i.e. pretending not to be an existing BT customer), however if they search with their BT landline number, it comes up saying they can have fibre optic.
Note the picture below, where I have used my landline number on the left, and then the neighbour who already has BT infinity fibre connection on the right. Both of us are connected to Cabinet 53 as you can see...(click each picture below in turn)
NOTE: this web site has now been replaced by this one https://speedtest.btwholesale.com/PerformanceTesterWS/diagnostics.do

imageimage
Update: 05/02/2013 15:04:56
From: Neville @ BTSent: 05 February 2013 14:50
Subject: Re: Cabinet 53
   
Hi Merrick - please see below for update:-
    
OR have come back and confirmed the cabinet 53 has been temporarily withdrawn from service as “full”. Or have activity to look at increasing the capacity and once completed will open the cabinet for service. Cabinets are available to all SPs/CP on equivalent basis so whilst you may only see BTR users reporting this does not mean that other users are not using the cabinet they may simply not be reporting.

OR have not given an indication of how long it will be before the cabinet comes back into service.



Update: 08/02/2013 22:58
Seems that sometimes the little guy can get stuff done then. Fibre available now to us again on the 26th February 2013.









Update:26/02/2013 10:36:30: I am now officially a plus.net fibre customer. I have to say that the gulf of difference between their customer service and BT is finally what made my mind up on which provider to choose. (P.S. Fibre is now available to all on our estate via cabinet 53 again, as of this morning 26th Feb 2013).
Update: 02/03/2013 11:37: After ringing up Plus.net about my order and letting them know that bt wholesale site are listing availability from the 12th March now, it appears that my Fibre connection is being put on hold for now.
image
Update: 12/03/2013 11:25: Checked this morning, and for some reason now the BT wholesale site is saying that there is no fibre available, and does NOT even list an availability date now!
image
I've kindly asked Neville at BT wholesale to look into this issue for me. Luckily he understands that people that are connected to this cabinet already have a fibre connection.
From: neville @bt.com
Sent: 12 March 2013 15:37
Subject: RE: Epsom cabinet 53

Hi Merrick – we have received an update from our suppliers to advise that providing no issues this cab should be back up and running by the end of next week. I can only suggest that you continue to monitor and place order as soon as it becomes available. Cheers Nev
Guess I'm going to have to keep waiting then.
Update: 13/03/2013 10:37: Now showing next Tuesday 19th March. Let's hope this is the last of it.
image
Update 27/03/2013 13:45: James Moyse (BT Open reach engineer number 606415840) came today and connected me to fibre finally. Have to say James was excellent, and confirmed my suspicions that there are a finite number of ports in the cabinet, and that there was nothing needing to be done at the exchange today in order to get me connected.
So I've now officially gone from this...
image
to this...
image
Also just to confirm that I wasn't crazy, it turns out that there are a finite number of new patch boards connected to the new fibre cabinet, and that these are solely occupied by BT customers at the moment. I'm now officially a plus.net fibre customer connected to number 71 of 150, so just glad I got in there before they all run out!
eng1
eng2

Thursday, 17 January 2013

Project Silk for all your HTML web application needs

A colleague of mine pointed out this white paper article that Microsoft have kindly put together, which appears to be a full overview on how to construct a web site in this day an age.

"Guidance for building cross-browser web applications with a focus on client-side interactivity. These applications take advantage of the latest web standards like HTML5, CSS3 and ECMAScript 5 along with modern web technologies such as jQuery, Internet Explorer 9, and ASP.NET MVC3"

http://silk.codeplex.com/

You can also download it all in pdf format from the following link

http://www.microsoft.com/en-us/download/details.aspx?id=27290

Friday, 28 December 2012

Javascript framework performance tester

Came across this little gem for testing the performance of javascript frameworks in your browser. Interesting to see how each browser performs...
http://jsperf.com/angular-vs-knockout-vs-ember/2
Also this is quite a good reference for all the difference frameworks that are out there at the moment to choose from
http://addyosmani.github.com/todomvc/
Performance test results for various browsers as follows...
IE 8.0 32-bit on Windows 7 64-bit
image
Chrome IE 9 32-bit on Windows 7 64-bit
image
Chrome 23.0.1271.97 32-bit on Windows 7 64-bit
image

Monday, 3 December 2012

How to clear the Windows 7 Print Spooler

http://support.microsoft.com/kb/946737 – Method D

Run the following commands in order from a command prompt. I just stick them in a batch file called fixprint.bat under the %windir% windows folder.

net stop spooler
del %systemroot%\system32\spool\printers\*.shd
del %systemroot%\system32\spool\printers\*.spl
net start spooler

Wednesday, 14 November 2012

How to Tune Up a Virtual PC

 

If your VPC seems slow try the following steps to rectify.

1. Have separate drives for your Page File, Host operating system, and VHD file

2.Try defragging again using O&O defrag (http://www.oo-software.com/home/en/products/oodefrag/) instead of the standard windows defrag tool, it works better. The steps below may take some time but should dramatically improve the responsiveness of your VPC. Make sure you have at least as much free space on your drive where the .vhd file is located as the current size of the .vhd. For example, if your .vhd file is 8GB, you need 8GB+ of free space. This much free space is not necessary but will speed up the defrag process. At the very least, try to have a couple gigs of free space before running defrag.

Warning: If you run these steps on a differencing or undo disk, compacting will require you to merge the differencing or undo disk with the original. If you cannot do this, your differencing or undo disk will be twice the size. However, it will most likely still perform better.

Note: Running defrag and precompacting are done inside the VPC. Compacting the disk is done using the Virtual PC Console with the VPC turned off.

Running Defrag (about 30 to 90 minutes depending on how fragmented the drive is)

1.     Download the defrag utility and extract the defrag.exe and defragps.dll files to a location on the VPC root drive.

2.     Inside the VPC, click Start, and then Run. Type cmd and press ENTER.

3.     Change the path to the location where you extracted the defrag.exe and defragps.dll files , i.e. cd c:\tools\defrag and press ENTER.

4.     Type defrag -d c: and press ENTER.

5.     Let this process go for awhile. At the end your .vhd file will be about twice the size.

Next, you must precompact inside the VPC before compacting the .vhd.

Running Precompact (about 10 minutes)

1.     On the VPC menu click CD, then Capture ISO Image.

2.     Browse to C:\Program Files\Microsoft Virtual PC\Virtual Machine Additions\

3.     Double-click Virtual Machine Precompactor.iso

4.     If it doesn't launch, open the D drive in Explorer and double-click precompact.exe.

5.     Let this process run. When it's done, shut down the VPC.

Now you can compact the .vhd file using the Virtual PC Console

Compacting the .vhd file (about 30 minutes)

1.     Go to the Virtual PC Console, select your VPC, and then click Settings.

2.     Select Hard Disk 1.

3.     Click Virtual Disk Wizard.

4.     Click Next on the first screen of the wizard.

5.     Click Edit an existing virtual disk, and then click Next.

6.     Click Browse on the Virtual Disk to Edit screen of the wizard and browse to your .vhd file. Select it and click Open.

7.     Click Next.

8.     Click Compact it (this should be the default), and then click Next.

9.     Click Replacing the original file, and then click Next.

10.  Click Finish. The disk compacting will start.

Other Performance Tips

  • Disable all visual enhancements

1.     Right-click My Computer, and then click Properties.

2.     On the Advanced tab click the Settings button in the Performance section.

3.     On the Visual Effects tab, click Custom then uncheck everything in the list below.

4.     Click OK.

  • Turn off automatic updates
  • Set hardware acceleration to full

1.     Right-click the desktop, and then click Properties.

2.    On the Settings tab click Advanced.

3.    On the Troubleshoot tab, move the Hardware acceleration slider to Full.

4.    Click OK

  • If you have an old spare 20GB drive lying around, you can use that as an external USB drive and dedicate the entire partition to a single VPC. This will have good performance even with undo disk on as there is virtually little or no fragmentation even over prolonged usage.
  • Hard disk paging is bad. Make sure that you balance memory allocation for both the VPC and the Host machine. Allocating too much memory to the VPC can cause your host machine to page to the hard disk and vice versa. With 2GB memory on the host machine, you can allocate 1GB to the VPC with good performance (even with Outlook 2007 and the IE browser running).
  • Try the Windows registry optimization with your host machine and VPCs.
    • Disable paging of the OS core files (look for the registry keyDisablePagingExecutive inHKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management and set the value to 0x1)
    • Disable the updating of the last access timestamp on the file system (run fsutil behavior set disablelastaccess 1 from the command prompt).
    • Reboot. Note the first registry tip is only useful if you have sufficient memory allocated to avoid hard disk paging.
  • To improve performance for applications in the VPC (applies to Windows Servers 2003)
    • Right click on Computer and select Properties.
    • Select the Advanced tab.
    • In the Performance section, click on Settings.
    • Under the Advanced tab, select best performance for Programs instead ofBackground services. For windows 2003 servers, this is normally set toBackground services.
    • Reboot.
  • If you have a Core Duo or Core 2 Duo processor on your machine, it should have support for hardware virtualization support. Make sure to do the following:
    • Turn on the Virtual Machine Monitor (VMM) in the bios settings. Depending on the bios type, there may be one or two settings related to this. Make sure all are enabled. If you do not see the settings in the bios, it means your hardware manufacturer has not implemented the support.
    • Enable Hardware Virtualization support in VirtualPC 2007. In the Virtual PC Console, go to File menu and select Options.
    • Under every VPC's settings, you should then be able to set the Hardware Virtualization option. This is only grayed out if you haven't done the previous two steps or if you don't have the right processor.
    • In the virtual machine, make sure that you have installed the latest VirtualPC 2007 Virtual Additions if you have not done so.

Tuesday, 30 October 2012

TSQL Performance Tuning

 

Below is an example of the TSQL you can use to investigate your stored procedure's performance. Best to put this in a snippet if you're using VS 2012 or greater versions of SQL Management Studio I find.

SET NOCOUNT ON

DBCC FREEPROCCACHE

DBCC DROPCLEANBUFFERS

CHECKPOINT

GO

PRINT ' '

PRINT '-- START: ProcName --------------------------------------------------------------------------------------------------------------------------------'

PRINT ' '

SET STATISTICS IO ON

SET STATISTICS TIME ON

EXEC dbo.MyProcNameHere

SET STATISTICS TIME OFF

SET STATISTICS IO OFF

PRINT ' '

PRINT '-- END: ProcName --------------------------------------------------------------------------------------------------------------------------------'

PRINT ' '

GO

Monday, 22 October 2012

YSlow CSS inspector

Just installed the YSlow browser extension for Chrome (although versions are available for other browsers too!).

http://developer.yahoo.com/yslow/

Not bad for finding where things on your site can be improved…

image

image

Monday, 25 June 2012

Using Apache benchmark to load test your web site

You can download the apache web server, then simply look inside the zip file for ab.exe.

E.g. to load test your site with 10 concurrent requests use the following command line...

>ab.exe -n 10 -c 10 http://localhost/mywebsite

For more information see 8.15mins into this video link...

http://channel9.msdn.com/Events/TechDays/Techdays-2012-the-Netherlands/2287

Thursday, 31 May 2012

How to gain detailed system information about your Windows 7 PC

 

1. Open the Performance Information and Tools option from control panel (or just hit [Windows Key] + [Break] together).

2. Click on the View and print detailed performance and system information link

image

3. Now you will see the following information, that you can event print out easily. This is how I found the model number for my laptop anyway...

image

4. For even more detailed information just run C:\Windows\System32\msinfo32.exe - or launch it from the msconfig.exe, Tools tab

image

Monday, 14 May 2012

Virtualization in WPF with VirtualizingStackPanel

First blogged about this on my previous blog site here
 
However, having come across this again today on a project, I thought it was important enough to re-blog!
Finally managed to figure out how to get virtualization to actually behave itself in a listbox wpf control.
Turns out that in order for Virtualization to work, you need three things satisfied.

1) Use a control that supports virtualization (e.g. list box or list view). (see Controls That Implement Performance Features section at bottom of this page for more info http://msdn.microsoft.com/en-us/library/cc716879.aspx#Controls )

2) Ensure that the ScrollViewer.CanContentScroll attached property is set to True on the containing list box / list view control.

3) Ensure that either the list box has a height set, or that it is contained within a parent Grid row, where that row definition has a height set (Height="*" will do if you want it to occupy the Client window height). Note: Do not use height=”Auto” as this will not work, as this instructs WPF to simply size the row to the height needed to fit all the items of the list box in, hence you do not get the vertical scroll bar appearing.

4) Ensure that there is no wrapping ScrollViewer control around the list box, as this will prevent virtualization from occuring.
 
5) Ensure that you use a VirtualizingStackPanel in the ItemsPanelTemplate for the ListBox.ItemsPanel
 
 
Example

<Grid Name="listBoxesGrid"
      Grid.Row="2">
  <Grid.ColumnDefinitions>
    <ColumnDefinition/>
    <ColumnDefinition/>
    <ColumnDefinition/>
  </Grid.ColumnDefinitions>
    <Grid.RowDefinitions>
        <RowDefinition Height="*"/>
    </Grid.RowDefinitions>

  <!-- Target Organizations listbox -->
  <ListBox Name="targetOrganizationsListBox"
           Grid.Column="0"
           HorizontalContentAlignment="Stretch"
           BorderThickness="0"
           Margin="5,10,15,2"
           ScrollViewer.HorizontalScrollBarVisibility="Disabled"
           ScrollViewer.CanContentScroll="True"
           VirtualizingStackPanel.IsVirtualizing="True"
           VirtualizingStackPanel.VirtualizationMode="Recycling"
           SelectionMode="Multiple"
           Width="Auto"
           Background="Transparent"
           ItemTemplate="{DynamicResource TargetOrgContactCard}"
           Height="Auto"
           Expander.MouseDoubleClick="targetOrganizationExpander_MouseDoubleClick"
                      Executed="OnAddToCallList" />
      <CommandBinding Command="local:SearchCoverageCommands.OpenCallDashboard"
                      Executed="OnOpenCallDashboard" />
      <CommandBinding Command="local:SearchCoverageCommands.AddComment"
                      Executed="OnAddComment" />
      <CommandBinding Command="local:SearchCoverageCommands.TargetCompanyChecked"
                      Executed="OnTargetCompanyChecked" />

    </ListBox.CommandBindings>
    <ListBox.ItemsPanel>
      <ItemsPanelTemplate>
          <VirtualizingStackPanel IsVirtualizing="True"
                                  VirtualizationMode="Recycling" />
      </ItemsPanelTemplate>
    </ListBox.ItemsPanel>
  </ListBox>

</Grid>

How to find the last interactive logons in Windows using PowerShell

Use the following powershell script to find the last users to login to a box since a given date, in this case the 21st April 2022 at 12pm un...