9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] env walk optimization
@ 2001-05-09  8:30 Peter Schay
  0 siblings, 0 replies; only message in thread
From: Peter Schay @ 2001-05-09  8:30 UTC (permalink / raw)
  To: 9fans

Hello,

Here's more on the performance subject; I hope the
following optimization is useful and not too inelegant.

The algorithm for walking in #e seems to be O(n*n).
I think it's pretty easy to make it O(n).

For example, on my system the following script takes no
time with 42 environment variables takes 4 seconds with
441 vars:

term% time /fd/0 <<.
#!/bin/rc
rfork e
eval X^(`{seq 1})^('=1')
echo nvars `{ls /env | wc -l}


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-05-09  8:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-09  8:30 [9fans] env walk optimization Peter Schay

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).