Skip to content

Conversation

@OmarTawfik
Copy link
Contributor

No description provided.

dsyme and others added 30 commits December 4, 2015 17:50
*copied from fsharp/fsharp#533

There may be a missing length check on exists, as without hte length check the cost of a comparison and a `call` is incurred.

Adding the simple len > 0 check before the loop appears (in the basic cases I have tested) to near triple performance.
```
let f arr = 
    Array.exists (fun e -> e = true) arr

for i in 0..60000000 do f ([||]:bool []) ;; // 1.8 seconds

let f2 arr = 
    if Array.length arr > 0 then
        Array.exists (fun e -> e = true) arr
    else 
        false

for i in 0..60000000 do f2 ([||]:bool []) ;; // 0.430 seconds
```

Note: this is something I have found an isolated instance of, it may be appropriate to ensure that such checks (if they are required, I can only speak for my use case) are consistant accross other modules, such as Seq\List.
Fix handling of optional IDispatch, IUnknown method args
Fix inlining on subtypes
OmarTawfik pushed a commit that referenced this pull request Mar 1, 2016
Merge latest updates from master
@OmarTawfik OmarTawfik merged commit f3f6175 into dotnet:roslyn Mar 1, 2016
@OmarTawfik OmarTawfik deleted the roslyn branch March 1, 2016 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants