Stephan Ferraro wrote: > If I understand it correctly the call of time() is a system call and requires > each time context switching etc... > > Would it be not faster (for the performance) that every libc linked program > opens only once at startup a device like /dev/time (which does not exists on > opensolaris) and uses mmap on it? > > Would this not be faster than executing each time a system call? > I mean the libc could then read the time directly from memory instead of > doing a system call each time. The libc call time() would still return the > current time. It would be transparent for normal userspace programs. > > What do you think?
Who are you asking? If you think that'd be faster, then I suggest that you prototype your idea and demonstrate how it works out to be faster and, better yet, how the difference is noticeable to some real application that makes lots of time() calls, while not harming one that makes just a few. Before doing that work, if I were you, I'd start by finding out how many CPU cycles are involved in that time() call. It's possible that it's not a worthwhile area to trim. -- James Carlson 42.703N 71.076W <carls...@workingcode.com> _______________________________________________ opensolaris-code mailing list opensolaris-code@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/opensolaris-code