Skip to content

Conversation

@Firestar99
Copy link
Collaborator

@Firestar99 Firestar99 commented Jul 7, 2025

high churn PR

Every single node used to generate their ProtoNodeIdentifier name on bootup with a LazyLock, now they are all &'static str to make them cheap to clone and compare. Would be curious if this improved bootup performance at all.

Also makes them accessible from gstd::ops::identity::IDENTIFIER: ProtoNodeIdentifier so instead of strings copy-pasted everywhere, we can now use this function to reference a node. This makes refactoring a lot easier, since you don't have to search the entire codebase for strings to fixup. (And yes, I already found a few that weren't adjusted or outright broken...)

@Firestar99 Firestar99 changed the title Make ProtoNodeIdentifier of a Node be accessible and always a borrowed &'static str Add identity() to node macro to return ProtoNodeIdentifier that is always a &'static str Jul 7, 2025
@Firestar99 Firestar99 force-pushed the proto_node_identifier branch from 87f93ab to 24eeb94 Compare July 7, 2025 18:11
@Firestar99 Firestar99 marked this pull request as ready for review July 7, 2025 18:34
@Firestar99 Firestar99 force-pushed the proto_node_identifier branch from d76de01 to 4e9455e Compare July 7, 2025 22:01
@Keavon Keavon force-pushed the proto_node_identifier branch from 4e9455e to 8e433f9 Compare July 7, 2025 22:10
@Keavon Keavon changed the title Add identity() to node macro to return ProtoNodeIdentifier that is always a &'static str Add ::IDENTITY to node macro to return a ProtoNodeIdentifier that is always a &'static str Jul 7, 2025
@Keavon Keavon merged commit 69ed80b into master Jul 7, 2025
4 checks passed
@Keavon Keavon deleted the proto_node_identifier branch July 7, 2025 23:30
urisinger pushed a commit to urisinger/Graphite that referenced this pull request Jul 15, 2025
… is always a `&'static str` (GraphiteEditor#2842)

* fix warnings on master

* make the `ProtoNodeIdentifier` of a Node be accessible and always a borrowed `&'static str`

* always generate `node_name::identifier()`, even with `skip_impl`

* make `FrontendNodeType` use Cow

* remove broken `DocumentNodeDefinition`s for old GPU nodes

* don't reexport `graphic_element` in it's entirety, only data structures

* adjust everything to use the new `node_name::identifier()`

* fixup imports for wasm

* turn identifier fn into a constant
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.

4 participants