Class reshaping and GC in ClassBuilder
Daniel Vainsencher
daniel.vainsencher at gmail.com
Wed Aug 17 18:55:38 UTC 2005
[How to test an image converted without GCs]
Hi Andreas, thanks for the test ideas! I'll play with it and let you know.
Another question. My problem is not with the GC per se, just with the
fact that it happens many times when reshaping Behavior. So a trivial
solution avoiding concurrency related problems is to expand the critical
section (have one for each call to CB, instead of one for each class
affected), and perform GC at its end.
The problem with this solution is clearly that it affects latency of any
other processes, but I'm not sure how big a problem that is in practice,
for this specific case.
Would you object to such a solution?
BTW - about the experiment mentioned in the previous mail: I found and
fixed a bug in some other change I introduced (don't recompile methods
that are not affected by shape changes, just copy them).
After rerunning the experiment, nothing is obviously wrong with the
image. Reshaping Behavior twice took 500s, 10 minutes, which I think is
about 6 times as fast as it was before.
Daniel
Andreas Raab wrote:
> I would write a test in which I:
> * create a (temporary) class and some instances
> * perform a particular operation to tests, such as:
> - adding iVar(s)
> - removing iVar(s)
> - swizzling iVar(s)
> * walk memory and do a sanity check for any object in which the class
> name is the same as that of your test class:
> - does it have the right values for its (old/new) class?
> - does it have the right length for its (old/new) class?
>
> If you want to get fancy throw in an extra high-priority process which
> randomly creates new objects of that class (just to improve the fun
> factor ;-) Any failure will likely crash your image but it should be
> good for testing if you save your image often.
>
> Also, you should probably run various combinations of the test in rapid
> succession since it is not clear what happens when you perform multiple
> reshaping steps.
>
> Cheers,
> - Andreas
>
>
More information about the Squeak-dev
mailing list
|