FFS, had to dig into .NET source code to rewrite their Array.Sort code that was slow as a dog. Dim - what's their address to send invoice to?
- Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
- Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!
FFS Microsoft
Collapse
X
-
-
-
-
Comment
-
The .NET array sort code is a quick sort algorithm. What did you replace it with?Originally posted by AtWFFS, had to dig into .NET source code to rewrite their Array.Sort code that was slow as a dog. Dim - what's their address to send invoice to?
Comment
-
Another FFS Microsoft....
http://www.youtube.com/watch?v=fV1kqthZf2g
Vista and speech recog...
I really don't understand why MS Product Managers do this to themselves...Comment
-
I improved the code but more importantly made sure the right sorter gets called, look at their source here, line 00844.
Notice that they would try to use non-.NET SZsort first, if it fails or some conditions set then they will try SorterObjectArray - this is much slower, but still okay, but they may also fall to the slowest piece of sh1t of a code SorterGenericArray: in profiler I could see that they were falling to it without good reason. So I took SorterObjectArray code and made sure it works with explicit types to allow compiler made optimisations, unlike ******** Microsoft programmers I am not lazy to copy paste same code with small changes to mak esure its optimised to the max. Say look at their code checking for presense of items:
if (items != null)
{ // do stuff
}
They do it in one tight loop, ffs, you can check it ONCE before calling that code and decide to call correct path to avoid making comparison that will yield same result all the time, ffs, sometimes copy/paste/lil-change approach is the best way to max performance.
FFS, and look at SorterObjectArray - because they forced Array.Sort to deal with arrays type of object[] it means they had to use Comparer, thus calling Int32 comparer on object rather than creating dozen copies of Array.Sort to deal with ALL primitive type combinations. FFS, this is obvious and certainly no excuse not to do in the base library that must be ultra fast!!!
It pissed me off big time that they were calling the slowest sorter of them all when I tried to sort int[],int[] arrays ffs, the difference is so big that its criminal to not spend 1 days making sure sorting is lighting fast - the base library code is not written for show of how one big superfunction can do it all ffs.Last edited by AtW; 1 August 2006, 14:41.Comment
-
-
I know better, but I am not the best programmer out there - .NET is done well, but its appauling to see such obvious lack of optimisations: clearly programmer optimised for his own writing time, ie think less and write just one easily maintainable version of Sorter, so he used object[] params, rather than specific int[] params (which is kind of done using Generics in .NET 2.0 but hard coded types are always better performance wise), also annoying that IF statement that will always be used but could have only checked once, its a recursive function ffs, and its sorting so clearly performance in this area is important especially because everyone is using same algorithm (quicksort), so optimising implementation is totally essential: I've done this small rewrite and sorting dropped off my radar now so I can look at other parts of my code. Bastards.Comment
-
Comment
- Home
- News & Features
- First Timers
- IR35 / S660 / BN66
- Employee Benefit Trusts
- Agency Workers Regulations
- MSC Legislation
- Limited Companies
- Dividends
- Umbrella Company
- VAT / Flat Rate VAT
- Job News & Guides
- Money News & Guides
- Guide to Contracts
- Successful Contracting
- Contracting Overseas
- Contractor Calculators
- MVL
- Contractor Expenses
Advertisers
Contractor Services
CUK News
- How salary sacrifice pension changes will hit contractors Dec 24 07:48
- All the big IR35/employment status cases of 2025: ranked Dec 23 08:55
- Why IT contractors are (understandably) fed up with recruitment agencies Dec 22 13:57
- Contractors, don’t fall foul of HMRC’s expenses rules this Christmas party season Dec 19 09:55
- A delay to the employment status consultation isn’t why an IR35 fix looks further out of reach Dec 18 08:22
- How asking a tech jobs agency basic questions got one IT contractor withdrawn Dec 17 07:21
- Are Home Office immigration policies sacrificing IT contractors for ‘cheap labour’? Dec 16 07:48
- Will 2026 see the return of the ‘Outside IR35’ contractor? Dec 15 07:51
- Contractors, Reeves’ dividends raid is disastrous. Act, but without acceptance Dec 12 07:10
- Why JSL indemnity clauses putting umbrella contractors on the hook could be a PR disaster Dec 11 07:36

Comment