impulse-org/pdb.values — pull request #31 by DavyLandman (2013-10-03 15:08:22+00:00)
Title: Removed URI's inside SourceLocation, reducing memory consumption by 50%

The URIs in source locations take up a lot of memory, especially in case of large sets of different URIs.

After discussion with @mahills and @jurgenvinju we decided we should really improve that memory usage.

In the end, importing a binary value file (500MB) with a lot of different source locations (A LOT), instead of requiring 6GB for the VM, 4GB is enough, and the memory usage went from 2GB to 1GB, so a very nice improvement in memory usage! And performance wise, not a measurable difference.

The only downside is that the `.getURI` call can now be a performance loss, but I added a LRU cache to decrease this. The same is for any code that is using the old deprecated overload with use a `URI` as input, there is some performance overhead, which again is reduced by using an LRU.

Both the standard text reader and binary reader are already optimized to use the new APIs.

Throughout rascal we will have to keep an `ISourceLocation` around instead of an `URI`.

The ISourceLocation now has extra fields, which were normally deferred to the `URI` class, except for the port,userinformation, and host field, new code should use those to acces the fields.