[Pharo-project] Speeding up Finder string search
Mariano Martinez Peck
marianopeck at gmail.com
Tue Jan 17 18:20:51 CET 2012
On Tue, Jan 17, 2012 at 5:58 PM, Stefan Marr <smalltalk at stefan-marr.de>wrote:
> On 17 Jan 2012, at 09:47, Mariano Martinez Peck wrote:
> > Stefan, another approach would be to store the source code in the
> compiled method trailer.
> Looks like everything is there already, but it does not seem to work
> stable enough.
Yes, that was pretty much the same idea I got when I tried it.
> With the code below, this should work: (do not apply the change to
> |trailer source m |
> m := (Gofer>>#load).
> trailer := m trailer.
> source := m getSource.
> trailer sourceCode: source.
> m recompileWithTrailer: trailer.
If you don't bother about being slow, you can also make it much easier:
|trailer source m |
m := (Gofer>>#load).
trailer := m trailer.
source := m getSource.
trailer sourceCode: source.
m becomeForward: (m copyWithTrailerBytes: trailer)
and if you want to do it for the whole image you can use one bulk become
and it will be fast.
I will experiment and see if it is working.
> > PS: I will interested if you do it :)
> In return, I would really appreciate if you could learn a bit about
> etiquette and quoting
99% of the cases I answer where I have to answer (like I am doing now).
But sometimes if my answer is obvious, I think it is much easier a top
posting than having to quote your email.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Pharo-project