Resident Good

Matt Dillon is bringing in resident executable support. This speeds loading of dynamically linked programs by saving a copy of their vmspace with vmspace_fork() in the kernel, and using that when executed instead of going through the regular, slower startup. This will replace prebinding.

Matt Dillon posted these preliminary numbers running a test program with Perl:

dynamic:2.860u 2.668s 0:05.61 98.3% 87+231k 0+0io 0pf+0w
prebinding:1.821u 2.095s 0:03.90 100.2% 34+202k 0+0io 1pf+0w
resident:1.239u 1.846s 0:03.08 99.6% 137+280k 0+0io 0pf+0w
statically linked:0.418u 0.867s 0:01.28 99.2% 808+616k 0+0io 0pf+0w

It is planned to make dynamic loading as fast as static. For those of you not familiar with the output of time, the first column is total time taken, the second is time taken to run the tested program, and the third is time consumed by system overhead. Yes, there are more columns than that. No, I don’t know what they mean.

2 Replies to “Resident Good”

  1. Poor Clueless Newbie says:

    Does anyone know the history behind this idea? Matt found this one somewhere, and I’d love to know…

  2. Garance Drosehn says:

    Well, it’s pretty similar to something I suggested on the freebsd-current mailing list when people were concerned about the performance penalty of switching all of /bin from statically-linked to dynamically-linked.


    My idea was based on some things we used to do in an operating system called MTS, and if you read all the followups to my post you’ll see that similar things had been done in other operating systems. For instance, these comments from Peter Jeremy:

    I seem to remember that Matt replied to my message with a reference to a similar feature in AmigaOS, but I can’t find that message right now.

Comments are closed.