Code Review: LoadCache

tfpt review /shelveset:LoadCache;REDMOND\tomat

Implements a simple load cache. Kernel#require uses relative paths to
determine whether a file has already been loaded. One file required from
multiple different directories using relative paths may therefore run
multiple times. We still need to run it multiple times but we need to
compile it only once unless the file content changed. This shelveset
introduces a very simple load cache. It doesn’t check timestamps of the
files for now, so if the file is modified it won’t load the new content.
The cache is also not using weak references, so it leaks memory. Will
revisit both issues post RailsConf.

Tomas

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs