Some things we found when doing performance analysis/benchmarking in a similar 
scenario (the general case for Nokia developers):
 
1) Import time is linear WRT # of source files under 
the root. 
After about 15K source files under the root it took a 
couple minutes to import a project.
At about 25K source files is took almost 5 minutes. We 
decided import was the time you click Finish on a project 
creation wizard until you can open a source file from the Project Explorer. 
We added a timer to our project creation 
action posted the project creation time to the error log the same way 
the Indexer does (i.e. Indexed '<project>' ....) so we could monitor 
problematic projects.
The majority of time importing is spent querying the file 
system for file attribs & directory sublists (refreshing is actually quite 
fast though to the user it appears to be a a lingering job)
 
2) Indexing time is related to # of file under the 
source roots. We introduced the concept of nested source roots but I see the 
target milestone was set to 7.0.
 
However, for you case of 40K source files, I think you 
will need e4 (as Doug already mentioned). 
I found any project with that many source files under the root makes 
the IDE about 
unusable.