I made a sample NetLogo model with 250 breeds and 250 breeds-own declarations, and it checked/compiled pretty quickly on my 2015 MacBook Pro, less than 1 second. I added some setup commands for each breed like create-types1 [ ; ... ] and checking got a little slower. Then I added some go statements as in your example like, ask types1 [ ; ... ] and it got slower still, getting to about 5 seconds for about 1000 lines of code.
I opened the DNA Replication Fork model from the models library, which is about 900 lines of code and has about a dozen breeds, and it also seemed to take about 5 seconds to load. This is very unscientific, I was just trying to get a handle on the source of the problem. At least on my MacBook, I can't quite confirm that the many breeds are the culprit for a slow check/compile, but it would certainly be an unusual way to write a model so I wouldn't count it out, either.
Either way, 30 seconds to 10 minutes definitely sounds like too long for a check/compile. If you're willing to submit your full model to bugs@ccl.northwestern.edu we can take a closer look and possibly open up an issue for whatever the core cause of the slowness is to eventually get a fix for.
Aside on View Updates
One thing I ran into in creating the below example: NetLogo desktop was very slow to update the view when I called reset-ticks with ~75,000 agents. You mention running with thousands of agents, but I wasn't sure if it was quite that many. In any case, if you don't need to see some agents while your model runs, you can do a set hidden? true when you create them, or turn off view updates entirely.
You mention that switching to the many-breeds helped your model's runtime performance, so I don't think this was your issue, but I want to mention it just in case.
Unbreeded Option
At the risk of answering a question you did not ask, here is an option to try to get the unbreeded solution working.
As JenB pointed out, you can pre-store agentsets in variables to avoid repeatedly computing them. The example you give just sets the breeds-own variable values for each type, which I would not expect to be very slow just using filtered agentsets (but I could be wrong!).
You mention looking for specific agents, and I'm wondering if there was a nested-search problem here. Something like ask turtles with [type = 1] [ ask turtles with [type = 2] [ ; ... do something ] ] could get very slow with lots of agents because that inner turtles with [type = 2] will get calculated for each type 1 turtle. Pre-calculating the filtered agentsets should help with that, either once per setup if you agents don't die or change type, or once per go tick if they do.
Here is an example. I'm using the table extension to store the pre-calculated agentsets with this version, because with so many types of agents it'll simplify the code quite a bit. In fact, it already has a primitive group-agents that handles grouping agents by the values of their variables. Because I don't know exactly what the agents are doing in your model, I've filled in some go code that sets some links just to show how you actually use the stored agent sets.
extensions [ table ]
globals [ turtle-type-numbers turtle-sets ]
turtles-own [ turtle-type a b c d ]
to setup
clear-all
; store the turtle type number list so we don't keep re-creating it
set turtle-type-numbers range 250
set turtle-sets table:make
foreach turtle-type-numbers [ turtle-type-number ->
create-turtles 100 [
set turtle-type turtle-type-number
set hidden? true
set a random 10
set b random 10
set c one-of [true false]
set d one-of ["apples" "oranges" "bananas"]
]
]
reset-ticks
end
to go
; at the start of each tick, re-query our turtle-sets
; if new turtles are not made and existing turtles do not change types
; then this could just be done once at the end of `setup` instead
set turtle-sets table:group-agents turtles [turtle-type]
ask links [ die ]
foreach turtle-type-numbers [ turtle-type-number ->
let typed-turtles (table:get turtle-sets turtle-type-number)
ask typed-turtles [
fd turtle-type mod 10
; link this turtle to one of the other types
; we just choose the next type number, get the agentset
; we stored previosuly, then choose `one-of` those
; turtles to link to.
let next-type (turtle-type + 1) mod 250
let next-turtles (table:get turtle-sets next-type)
create-link-with one-of next-turtles
]
]
tick
end
I hope that is helpful.