Last active
April 26, 2017 20:22
-
-
Save bohdanszymanik/072b5f26b4c1713de88f7031afc515ac to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// running in fable.io/repl to check performance on 32 bit win 7 with chrome | |
type Agent<'T> = MailboxProcessor<'T> | |
let agent = | |
Agent.Start(fun inbox -> | |
async { while true do | |
let! msg = inbox.Receive() | |
printfn "got message '%s'" msg } ) | |
agent.Post "hello" | |
let agents = | |
[for i in 0..100000 -> | |
Agent.Start(fun inbox -> | |
async { while true do | |
let! msg = inbox.Receive() | |
printfn "%d got message '%s'" i msg } ) | |
] | |
agents.[8].Post "here" | |
agents.[80].Post "here" | |
agents.[800].Post "here" | |
agents.[8000].Post "here" | |
// this is where it get's noticeably slow on win 7 32bit pc, | |
agents.[80000].Post "here" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment