Skip to content

lexer redesign#2

Merged
jensneuse merged 2 commits intomasterfrom
performance-refactoring
Jan 2, 2019
Merged

lexer redesign#2
jensneuse merged 2 commits intomasterfrom
performance-refactoring

Conversation

@jensneuse
Copy link
Copy Markdown
Member

redesign the way the lexer emits tokens to reduce both cpu and memory pressure

@jensneuse jensneuse merged commit 7688e81 into master Jan 2, 2019
@jensneuse jensneuse deleted the performance-refactoring branch January 2, 2019 13:58
jensneuse added a commit that referenced this pull request Feb 24, 2020
ysmolski added a commit that referenced this pull request Dec 16, 2025
This produces format that is easier to read:

```
CreatePlanningPaths
===================

Found potentially missing path query.accounts.complex

Planned paths on initial run #1:
	should revisit
	has missing paths
	has fields waiting for dependency

	Missing paths:
		query.accounts.complex

	Run #1. Planner ID 0
		Parent = query
		Datasource ID = id-1, name = id-1, hash = 11987355753863978781
		Paths:
{"ds":11987355753863978781,"path":"query","shouldWalkFields":true,"pathType":"parent"}
{"ds":11987355753863978781,"path":"query.accounts","fieldRef":  2,"typeName":"Query","shouldWalkFields":true,"isRootNode":true,"pathType":"field"}
{"ds":11987355753863978781,"path":"query.accounts.id","fieldRef":  0,"typeName":"User","shouldWalkFields":true,"isRootNode":true,"pathType":"field"}
{"ds":11987355753863978781,"path":"query.accounts.__typename","fieldRef":  7,"typeName":"User","shouldWalkFields":true,"isRootNode":false,"pathType":"field"}

	Run #1. Planner ID 1
		Parent = query.accounts
		Datasource ID = id-2, name = id-2, hash = 14787246084284009732
		Depends on planner IDs: [0]
		Required fields:
			key {"type_name":"User","selection_set":"id","RemappedPaths":null}
		Paths:
{"ds":14787246084284009732,"path":"query.accounts","shouldWalkFields":true,"pathType":"parent"}
{"ds":14787246084284009732,"path":"query.accounts.nested","fieldRef":  3,"typeName":"User","shouldWalkFields":true,"isRootNode":true,"pathType":"field"}
{"ds":14787246084284009732,"path":"query.accounts.nested.__typename","fieldRef":  4,"typeName":"Nested","shouldWalkFields":true,"isRootNode":false,"pathType":"field"}
{"ds":14787246084284009732,"path":"query.accounts.nested.property","fieldRef":  5,"typeName":"Nested","shouldWalkFields":true,"isRootNode":false,"pathType":"field"}
{"ds":14787246084284009732,"path":"query.accounts.nested.name","fieldRef":  6,"typeName":"Nested","shouldWalkFields":true,"isRootNode":false,"pathType":"field"}

Planned paths on run #2:

	Run #2. Planner ID 0
		Parent = query
		Datasource ID = id-1, name = id-1, hash = 11987355753863978781
		Paths:
{"ds":11987355753863978781,"path":"query","shouldWalkFields":true,"pathType":"parent"}
{"ds":11987355753863978781,"path":"query.accounts","fieldRef":  2,"typeName":"Query","shouldWalkFields":true,"isRootNode":true,"pathType":"field"}
{"ds":11987355753863978781,"path":"query.accounts.id","fieldRef":  0,"typeName":"User","shouldWalkFields":true,"isRootNode":true,"pathType":"field"}
{"ds":11987355753863978781,"path":"query.accounts.__typename","fieldRef":  7,"typeName":"User","shouldWalkFields":true,"isRootNode":false,"pathType":"field"}

	Run #2. Planner ID 1
		Parent = query.accounts
		Datasource ID = id-2, name = id-2, hash = 14787246084284009732
		Depends on planner IDs: [0]
		Required fields:
			key {"type_name":"User","selection_set":"id","RemappedPaths":null}
		Paths:
{"ds":14787246084284009732,"path":"query.accounts","shouldWalkFields":true,"pathType":"parent"}
{"ds":14787246084284009732,"path":"query.accounts.nested","fieldRef":  3,"typeName":"User","shouldWalkFields":true,"isRootNode":true,"pathType":"field"}
{"ds":14787246084284009732,"path":"query.accounts.nested.__typename","fieldRef":  4,"typeName":"Nested","shouldWalkFields":true,"isRootNode":false,"pathType":"field"}
{"ds":14787246084284009732,"path":"query.accounts.nested.property","fieldRef":  5,"typeName":"Nested","shouldWalkFields":true,"isRootNode":false,"pathType":"field"}
{"ds":14787246084284009732,"path":"query.accounts.nested.name","fieldRef":  6,"typeName":"Nested","shouldWalkFields":true,"isRootNode":false,"pathType":"field"}

	Run #2. Planner ID 2
		Parent = query.accounts
		Datasource ID = id-1, name = id-1, hash = 11987355753863978781
		Depends on planner IDs: [0 1]
		Required fields:
		required by complex: {"type_name":"User","field_name":"complex","selection_set":"nested { property name }","RemappedPaths":{}}
			key {"type_name":"User","selection_set":"id","RemappedPaths":null}
		Paths:
{"ds":11987355753863978781,"path":"query.accounts","shouldWalkFields":true,"pathType":"parent"}
{"ds":11987355753863978781,"path":"query.accounts.complex","fieldRef":  1,"typeName":"User","shouldWalkFields":true,"isRootNode":true,"pathType":"field"}
```
ysmolski added a commit that referenced this pull request Dec 16, 2025
This produces format that is easier to read:

```
CreatePlanningPaths
===================

Found potentially missing path query.accounts.complex

Planned paths on initial run #1:
	should revisit
	has missing paths
	has fields waiting for dependency

	Missing paths:
		query.accounts.complex

	Run #1. Planner ID 0
		Parent = query
		Datasource ID = id-1, name = id-1, hash = 11987355753863978781
		Paths:
{"ds":11987355753863978781,"path":"query","shouldWalkFields":true,"pathType":"parent"}
{"ds":11987355753863978781,"path":"query.accounts","fieldRef":  2,"typeName":"Query","shouldWalkFields":true,"isRootNode":true,"pathType":"field"}
{"ds":11987355753863978781,"path":"query.accounts.id","fieldRef":  0,"typeName":"User","shouldWalkFields":true,"isRootNode":true,"pathType":"field"}
{"ds":11987355753863978781,"path":"query.accounts.__typename","fieldRef":  7,"typeName":"User","shouldWalkFields":true,"isRootNode":false,"pathType":"field"}

	Run #1. Planner ID 1
		Parent = query.accounts
		Datasource ID = id-2, name = id-2, hash = 14787246084284009732
		Depends on planner IDs: [0]
		Required fields:
			key {"type_name":"User","selection_set":"id","RemappedPaths":null}
		Paths:
{"ds":14787246084284009732,"path":"query.accounts","shouldWalkFields":true,"pathType":"parent"}
{"ds":14787246084284009732,"path":"query.accounts.nested","fieldRef":  3,"typeName":"User","shouldWalkFields":true,"isRootNode":true,"pathType":"field"}
{"ds":14787246084284009732,"path":"query.accounts.nested.__typename","fieldRef":  4,"typeName":"Nested","shouldWalkFields":true,"isRootNode":false,"pathType":"field"}
{"ds":14787246084284009732,"path":"query.accounts.nested.property","fieldRef":  5,"typeName":"Nested","shouldWalkFields":true,"isRootNode":false,"pathType":"field"}
{"ds":14787246084284009732,"path":"query.accounts.nested.name","fieldRef":  6,"typeName":"Nested","shouldWalkFields":true,"isRootNode":false,"pathType":"field"}

Planned paths on run #2:

	Run #2. Planner ID 0
		Parent = query
		Datasource ID = id-1, name = id-1, hash = 11987355753863978781
		Paths:
{"ds":11987355753863978781,"path":"query","shouldWalkFields":true,"pathType":"parent"}
{"ds":11987355753863978781,"path":"query.accounts","fieldRef":  2,"typeName":"Query","shouldWalkFields":true,"isRootNode":true,"pathType":"field"}
{"ds":11987355753863978781,"path":"query.accounts.id","fieldRef":  0,"typeName":"User","shouldWalkFields":true,"isRootNode":true,"pathType":"field"}
{"ds":11987355753863978781,"path":"query.accounts.__typename","fieldRef":  7,"typeName":"User","shouldWalkFields":true,"isRootNode":false,"pathType":"field"}

	Run #2. Planner ID 1
		Parent = query.accounts
		Datasource ID = id-2, name = id-2, hash = 14787246084284009732
		Depends on planner IDs: [0]
		Required fields:
			key {"type_name":"User","selection_set":"id","RemappedPaths":null}
		Paths:
{"ds":14787246084284009732,"path":"query.accounts","shouldWalkFields":true,"pathType":"parent"}
{"ds":14787246084284009732,"path":"query.accounts.nested","fieldRef":  3,"typeName":"User","shouldWalkFields":true,"isRootNode":true,"pathType":"field"}
{"ds":14787246084284009732,"path":"query.accounts.nested.__typename","fieldRef":  4,"typeName":"Nested","shouldWalkFields":true,"isRootNode":false,"pathType":"field"}
{"ds":14787246084284009732,"path":"query.accounts.nested.property","fieldRef":  5,"typeName":"Nested","shouldWalkFields":true,"isRootNode":false,"pathType":"field"}
{"ds":14787246084284009732,"path":"query.accounts.nested.name","fieldRef":  6,"typeName":"Nested","shouldWalkFields":true,"isRootNode":false,"pathType":"field"}

	Run #2. Planner ID 2
		Parent = query.accounts
		Datasource ID = id-1, name = id-1, hash = 11987355753863978781
		Depends on planner IDs: [0 1]
		Required fields:
		required by complex: {"type_name":"User","field_name":"complex","selection_set":"nested { property name }","RemappedPaths":{}}
			key {"type_name":"User","selection_set":"id","RemappedPaths":null}
		Paths:
{"ds":11987355753863978781,"path":"query.accounts","shouldWalkFields":true,"pathType":"parent"}
{"ds":11987355753863978781,"path":"query.accounts.complex","fieldRef":  1,"typeName":"User","shouldWalkFields":true,"isRootNode":true,"pathType":"field"}
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant