Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v3] performance problems when compiling a single method #913

Open
dalehenrich opened this issue Jan 18, 2024 · 0 comments
Open

[v3] performance problems when compiling a single method #913

dalehenrich opened this issue Jan 18, 2024 · 0 comments
Assignees
Labels
next up top of todo list

Comments

@dalehenrich
Copy link
Member

Internal error "48991 Rowan performance problems when compiling a single method".

Since Rowan 1, the method RwPrjBrowserToolV2 >>#addOrUpdateMethod:dictionaries:inProtocol:forClassNamed:isMeta:inPackageNamed: has been used to compile a single method and the brute force technique that has been used involves making a copy of the entire project definition, then adding or updating a method definition for the changed method with the new source, then doing a compare of the copied project definition with the current project definition to produce a project modification consisting of the the change to the method ... this is incredibly expensive ... it should be much more efficient to directly create the project modification directly.

The following doit produces a project modification that contains a single methodModification:

| result beforeMethod afterMethod classDefinition before_source  after_source category 
	methodModification classModification theClass theClassName instanceMethodsModification
	packageDefinition thePackageName packageModification classesModification
	projectDefinition theProjectName projectModification packagesModification
|

category := 'issue 48991'.
theClassName := 'Issue48991'.
thePackageName := 'Issue48991-Core'.
theProjectName := 'Issue48991-Project'.

theClass := Object
	subclass: theClassName
	instVarNames: #()
	classVars: #()
	classInstVars: #()
	poolDictionaries: #()
	inDictionary: UserGlobals
	options: #().
theClass category: category.

before_source := 'issue48991 "comment" ^self '.
after_source := 'issue48991 ^ self'.

result := RwProjectSetModification new.
"result addElementModification:"

classDefinition := RwClassDefinition newForClassNamed: theClassName super: 'Object' category: category.

packageDefinition := RwPackageDefinition newNamed: thePackageName.

projectDefinition := (RwProjectDefinition new)
	projectName: theProjectName;
	yourself.

beforeMethod := RwMethodDefinition newForSource: before_source protocol: category.
afterMethod := RwMethodDefinition newForSource: after_source protocol: category.

projectModification := projectDefinition compareAgainstBase: projectDefinition.
packagesModification := RwPackagesModification new.
packageModification := packageDefinition compareAgainstBase: packageDefinition.
classesModification := RwClassesModification new.
classModification := classDefinition compareAgainstBase: classDefinition.
instanceMethodsModification := RwMethodsModification extendedClassName: theClassName.

methodModification :=  (afterMethod compareAgainstBase: beforeMethod)
	isMeta: false;
	classDefinition: classDefinition;
	yourself.

methodModification isEmpty
	ifFalse: [ instanceMethodsModification addElementModification: methodModification ].

instanceMethodsModification isEmpty
	ifFalse: [classModification instanceMethodsModification: instanceMethodsModification ].

classModification isEmpty
	ifFalse: [ classesModification addElementModification: classModification ].

classesModification isEmpty
	ifFalse: [ packageModification classesModification: classesModification ].

packageModification isEmpty
	ifFalse: [ packagesModification addElementModification: packageModification ].

projectModification packagesModification: packagesModification.

projectModification halt.

This doit should be massaged and used to replace the current RwPrjBrowserToolV2 >>#addOrUpdateMethod:dictionaries:inProtocol:forClassNamed:isMeta:inPackageNamed: implementation...

@dalehenrich dalehenrich added the next up top of todo list label Jan 18, 2024
@dalehenrich dalehenrich self-assigned this Jan 18, 2024
dalehenrich added a commit that referenced this issue Jan 18, 2024
…Core ... the final resting place of this class ... eliminated methods with no senders
dalehenrich added a commit that referenced this issue Jan 20, 2024
…wPrjBrowserToolV2 >>#addOrUpdateMethod:dictionaries:inProtocol:forClassNamed:isMeta:inPackageNamed:
dalehenrich added a commit that referenced this issue Jan 21, 2024
… unused outside of tests; move some more methods to Obsolete packages since they should be eilminated as part of #909 owrk
dalehenrich added a commit that referenced this issue Jan 21, 2024
dalehenrich added a commit that referenced this issue Jan 21, 2024
dalehenrich added a commit that referenced this issue Jan 21, 2024
dalehenrich added a commit that referenced this issue Jan 21, 2024
…g moveMethod changes; a bit of refactoring prior to handling method move between packages
dalehenrich added a commit that referenced this issue Jan 22, 2024
…kagesModificationsForMethodDefinition:toClass:isMeta:toPackage:using: ... it seems that RwPrjBrowserTool >> packagesModificationForRemoveMethod:fromClass:isMeta:fromPackage: is working correctly
dalehenrich added a commit that referenced this issue Jan 22, 2024
…nition:toClass:isMeta:toPackage:using:, tests for move method between categories and move method between packages are passing --- comment applies to previous commit [bbbf414]
dalehenrich added a commit that referenced this issue Jan 23, 2024
…eta: for direct construction of projectSetModification; added passing tests
dalehenrich added a commit that referenced this issue Jan 23, 2024
…type:superclass:instVarNames:classVars:classInstVars:poolDictionaries:category:packageName:options:; add passing add class test
dalehenrich added a commit that referenced this issue Jan 24, 2024
dalehenrich added a commit that referenced this issue Jan 24, 2024
dalehenrich added a commit that referenced this issue Jan 25, 2024
…correct projecet set modification (8 of 9 tests passing)
dalehenrich added a commit that referenced this issue Jan 27, 2024
…ed new class versions, so something is fishy in the test code or these changes
dalehenrich added a commit that referenced this issue Jan 30, 2024
…lass passes, so experimental changes look good ... will need to run full battery suite test to confirm
dalehenrich added a commit that referenced this issue Feb 14, 2024
…/update and is passing testsAddExtensionMethod is not passing
dalehenrich added a commit that referenced this issue Feb 15, 2024
…, but isEmpty needs to be replaced is isNullModification ... loaded projects being used instead of project definitions (for efficiency) results in a misMatch in the semantics of isEmpty ... isNullModification will rectify this particular problem
dalehenrich added a commit that referenced this issue Feb 16, 2024
dalehenrich added a commit that referenced this issue Feb 16, 2024
…dificationsForMethodDefinition:toClass:isMeta:toPackage:using:; passing testeAddMethod and testAddExtensionMethod audit failure in testMoveMethodBetweenPackages
dalehenrich added a commit that referenced this issue Feb 16, 2024
…prove audit error when expected category for package convention is not present in class, when there ARE extension methods in the class
dalehenrich added a commit that referenced this issue Feb 16, 2024
… testMoveMethodBetweenPackages are all passing
dalehenrich added a commit that referenced this issue Feb 16, 2024
… testMoveMethodBetweenPackages, testDeleteGlobalExtensionMethod, testDeleteMethod, and testDeleteExtensionMethod are all passing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
next up top of todo list
Projects
None yet
Development

No branches or pull requests

1 participant