From: SASADA Koichi Date: 2012-10-28T07:36:51+09:00 Subject: [ruby-core:48505] Re: [ruby-trunk - Bug #7158] require is slow in its bookkeeping; can make Rails startup 2.2x faster (2012/10/28 7:10), h.shirosaki (Hiroshi Shirosaki) wrote: > I think (S1) is more compatible trunk. It expands only relative load path always. Trunk expands all load path always. > If load path has many relative load path, (G1) to (G4) + (S1) performance is more close to (G1) to (G3) since relative paths are no cache. > I didn't show benchmark result of that. > > (S2) is similar approach as Yura's #5767. It caches also relative load path. If current working directory was changed, it invalidates load path cache when getting expanded load path. > I can't find test cases which fail so far. Yura's patch is widely used (I'm also using it with 1.9.3) without issues. I think it's enough compatible. > > I thought (S3) would give performance improvement in theory since it reduces expand costs to use expanded path. But my benchmark shows very small improvement. Yura's #5767 also uses this. Another benchmark might show more meaningful improvement result. If (S2) is enough compatible, (S3) would be also enough compatible because using same expanded load path cache. Thanks a lot for your explanation. I'm very happy if you describe the "changed behavior/assumption". Your explanation is "how to do it". But we need to know "what changed". Sorry if I misunderstood your explanation. Or no behavior changed except "freeze $LOAD_PATH" by (G3)? (Your words "enough compatible" meant that?) Thanks, Koichi -- // SASADA Koichi at atdot dot net