|
Writing code in this way seems to be about 2.4 times slower in Pharo 7
vs Pharo 6.
I also tried with smaller numbers, and there I noticed a rather high
number of calls
to File>>basicOpenForWrite:. With 4*4*4 methods, 768, and 5*5*5 1502.
|organizer aToZ|
organizer := RPackageOrganizer default.
aToZ := 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.
[ aToZ do: [ :ch | |packageName package|
packageName := 'Package', ch asString.
package := organizer createPackageNamed: packageName.
aToZ do: [ :classCh | |cls|
cls := Object subclass: (ch asString, 'Class', classCh asString)
asSymbol
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
package: packageName.
package addClassDefinition: cls.
aToZ do: [ :m |
cls compile: m asString asLowercase, String cr, ' ^self' ]
] ] ] timeProfile
(221 s vs 93)
Do I need all those calls to #basicOpenForWrite?
Stephan
|