Mail Archives: djgpp-workers/2002/10/15/02:29:47
> perhaps a realistic estimates is around 3-10 times for others.
> Preparing procedure set_hash_env() will effectively slowdown putenv() a bit,
> but we putenv less frequently than getenv, right?
If we cache getenv() properly in the tzset(), we'll only call it once.
So there's the chance that you call putenv() more frequently (in
initialization) than getenv() at runtime.
With the very sparse distribution of letters, I think it would be much
more space efficient to mask the lower 4 or 5 bits for the buckets
(16 or 32 should be fine, 256 is overkill). This also would speed up
the initial setup.
Here's my proposed patch for ctime.c:
*** ctime.bak Sun Jun 9 13:20:22 2002
--- ctime.c Tue Oct 15 01:24:06 2002
*************** tzset(void)
*** 920,926 ****
/* If environ didn't changed since last time, don't waste time
looking at $TZ. */
! if (lcl_is_set > 0 && __environ_changed == last_env_changed)
return;
/* If environ did change, but $TZ wasn't changed since last time we
--- 920,926 ----
/* If environ didn't changed since last time, don't waste time
looking at $TZ. */
! if (lcl_is_set != 0 && __environ_changed == last_env_changed)
return;
/* If environ did change, but $TZ wasn't changed since last time we
- Raw text -