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

Refactor the node macro and simply most of the node implementations #1942

Merged
merged 63 commits into from
Sep 20, 2024

Conversation

TrueDoctor
Copy link
Member

@TrueDoctor TrueDoctor commented Aug 20, 2024

Closes #1881, closes #1612

(Also fixes #1591)

@Keavon Keavon changed the title Rework node macro Refactor the node macro and simply most of the node implementations Sep 20, 2024
Copy link
Member

@Keavon Keavon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Insert party parrot

Copy link

github-actions bot commented Sep 20, 2024

Performance Benchmark Results

compile_demo_art::compile_group::iai_compile_to_proto with_setup_0:load_from_name(isometric-fountain)
Instructions: 62,761,090 (master) -> 60,089,681 (HEAD) : $$\color{lime}-4.26\%$$

Detailed metrics
Baselines:                master|       HEAD
D1mr                     483,680|    457,626          -5.39%
D1mw                     181,261|    165,682          -8.59%
DLmr                      59,115|     52,507         -11.18%
DLmw                     108,678|    103,133          -5.10%
Dr                    14,549,577| 13,956,188          -4.08%
Dw                    10,687,561| 10,224,864          -4.33%
EstimatedCycles       96,410,828| 92,069,773          -4.50%
I1mr                     167,964|    147,182         -12.37%
ILmr                       1,573|      1,596          +1.46%
Ir                    62,761,090| 60,089,681          -4.26%
L1hits                87,165,323| 83,500,243          -4.20%
LLhits                   663,539|    613,254          -7.58%
RamHits                  169,366|    157,236          -7.16%
TotalRW               87,998,228| 84,270,733          -4.24%

compile_demo_art::compile_group::iai_compile_to_proto with_setup_1:load_from_name(painted-dreams)
Instructions: 27,901,724 (master) -> 26,377,530 (HEAD) : $$\color{lime}-5.46\%$$

Detailed metrics
Baselines:                master|       HEAD
D1mr                     228,429|    212,448          -7.00%
D1mw                      87,861|     83,253          -5.24%
DLmr                       3,943|      2,395         -39.26%
DLmw                      14,516|     23,363         +60.95%
Dr                     6,969,682|  6,658,222          -4.47%
Dw                     5,229,023|  5,010,706          -4.18%
EstimatedCycles       42,263,279| 40,294,484          -4.66%
I1mr                      74,820|     61,863         -17.32%
ILmr                       1,488|      1,501          +0.87%
Ir                    27,901,724| 26,377,530          -5.46%
L1hits                39,709,319| 37,688,894          -5.09%
LLhits                   371,163|    330,305         -11.01%
RamHits                   19,947|     27,259         +36.66%
TotalRW               40,100,429| 38,046,458          -5.12%

compile_demo_art::compile_group::iai_compile_to_proto with_setup_2:load_from_name(procedural-string-lights)
Instructions: 7,180,128 (master) -> 6,837,533 (HEAD) : $$\color{lime}-4.77\%$$

Detailed metrics
Baselines:                master|       HEAD
D1mr                      42,065|     37,889          -9.93%
D1mw                      24,727|     21,189         -14.31%
DLmw                       3,549|      9,594        +170.33%
Dr                     1,790,391|  1,574,855         -12.04%
Dw                     1,389,358|  1,180,366         -15.04%
EstimatedCycles       10,811,087| 10,187,272          -5.77%
I1mr                      19,273|     17,499          -9.20%
ILmr                          16|         12         -25.00%
Ir                     7,180,128|  6,837,533          -4.77%
L1hits                10,273,812|  9,516,177          -7.37%
LLhits                    82,500|     66,970         -18.82%
RamHits                    3,565|      9,607        +169.48%
TotalRW               10,359,877|  9,592,754          -7.40%

compile_demo_art::compile_group::iai_compile_to_proto with_setup_3:load_from_name(red-dress)
Instructions: 71,627,078 (master) -> 69,690,229 (HEAD) : $$\color{lime}-2.70\%$$

Detailed metrics
Baselines:                master|       HEAD
D1mr                     569,164|    555,399          -2.42%
D1mw                     207,988|    206,457          -0.74%
DLmr                      77,713|     70,421          -9.38%
DLmw                     110,644|    117,198          +5.92%
Dr                    16,658,533| 16,166,574          -2.95%
Dw                    12,211,005| 11,862,016          -2.86%
EstimatedCycles      110,088,544|107,099,875          -2.71%
I1mr                     196,205|    164,453         -16.18%
ILmr                       1,593|      1,575          -1.13%
Ir                    71,627,078| 69,690,229          -2.70%
L1hits                99,523,259| 96,792,510          -2.74%
LLhits                   783,407|    737,115          -5.91%
RamHits                  189,950|    189,194          -0.40%
TotalRW              100,496,616| 97,718,819          -2.76%

compile_demo_art::compile_group::iai_compile_to_proto with_setup_4:load_from_name(valley-of-spires)
Instructions: 50,455,549 (master) -> 49,010,580 (HEAD) : $$\color{lime}-2.86\%$$

Detailed metrics
Baselines:                master|       HEAD
D1mr                     372,855|    346,658          -7.03%
D1mw                     143,605|    125,913         -12.32%
DLmr                      32,419|     29,609          -8.67%
DLmw                      57,570|     71,279         +23.81%
Dr                    11,665,835| 11,316,602          -2.99%
Dw                     8,560,743|  8,303,624          -3.00%
EstimatedCycles       76,022,407| 74,038,328          -2.61%
I1mr                     132,540|    111,722         -15.71%
ILmr                       1,487|      1,457          -2.02%
Ir                    50,455,549| 49,010,580          -2.86%
L1hits                70,033,127| 68,046,513          -2.84%
LLhits                   557,524|    481,948         -13.56%
RamHits                   91,476|    102,345         +11.88%
TotalRW               70,682,127| 68,630,806          -2.90%

Copy link

Performance Benchmark Results

compile_demo_art::compile_group::iai_compile_to_proto with_setup_0:load_from_name(isometric-fountain)
Instructions: 62,748,065 (master) -> 60,093,246 (HEAD) : $$\color{lime}-4.23\%$$

Detailed metrics
Baselines:                master|       HEAD
D1mr                     483,943|    457,649          -5.43%
D1mw                     181,442|    165,449          -8.81%
DLmr                      59,212|     52,527         -11.29%
DLmw                     108,823|    102,428          -5.88%
Dr                    14,545,975| 13,957,127          -4.05%
Dw                    10,684,990| 10,225,818          -4.30%
EstimatedCycles       96,400,620| 92,054,319          -4.51%
I1mr                     167,960|    147,234         -12.34%
ILmr                       1,572|      1,605          +2.10%
Ir                    62,748,065| 60,093,246          -4.23%
L1hits                87,145,685| 83,505,859          -4.18%
LLhits                   663,738|    613,772          -7.53%
RamHits                  169,607|    156,560          -7.69%
TotalRW               87,979,030| 84,276,191          -4.21%

compile_demo_art::compile_group::iai_compile_to_proto with_setup_1:load_from_name(painted-dreams)
Instructions: 27,892,978 (master) -> 26,378,732 (HEAD) : $$\color{lime}-5.43\%$$

Detailed metrics
Baselines:                master|       HEAD
D1mr                     229,647|    213,315          -7.11%
D1mw                      89,052|     82,883          -6.93%
DLmr                       4,009|      2,419         -39.66%
DLmw                      26,675|     23,364         -12.41%
Dr                     6,967,864|  6,658,281          -4.44%
Dw                     5,227,799|  5,010,612          -4.15%
EstimatedCycles       42,628,633| 40,298,431          -5.47%
I1mr                      74,904|     61,851         -17.43%
ILmr                       1,502|      1,504          +0.13%
Ir                    27,892,978| 26,378,732          -5.43%
L1hits                39,695,038| 37,689,576          -5.05%
LLhits                   361,417|    330,762          -8.48%
RamHits                   32,186|     27,287         -15.22%
TotalRW               40,088,641| 38,047,625          -5.09%

compile_demo_art::compile_group::iai_compile_to_proto with_setup_2:load_from_name(procedural-string-lights)
Instructions: 7,180,388 (master) -> 6,839,772 (HEAD) : $$\color{lime}-4.74\%$$

Detailed metrics
Baselines:                master|       HEAD
D1mr                      42,168|     38,218          -9.37%
D1mw                      24,800|     21,205         -14.50%
DLmr                           0|          0          +0.00%
DLmw                       3,534|      3,343          -5.40%
Dr                     1,790,594|  1,575,229         -12.03%
Dw                     1,389,574|  1,180,782         -15.03%
EstimatedCycles       10,811,736| 10,003,965          -7.47%
I1mr                      19,202|     17,460          -9.07%
ILmr                          16|         12         -25.00%
Ir                     7,180,388|  6,839,772          -4.74%
L1hits                10,274,386|  9,518,900          -7.35%
LLhits                    82,620|     73,528         -11.00%
RamHits                    3,550|      3,355          -5.49%
TotalRW               10,360,556|  9,595,783          -7.38%

compile_demo_art::compile_group::iai_compile_to_proto with_setup_3:load_from_name(red-dress)
Instructions: 71,629,866 (master) -> 69,690,807 (HEAD) : $$\color{lime}-2.71\%$$

Detailed metrics
Baselines:                master|       HEAD
D1mr                     570,131|    554,622          -2.72%
D1mw                     209,389|    206,086          -1.58%
DLmr                      77,873|     70,293          -9.73%
DLmw                     110,489|    116,961          +5.86%
Dr                    16,658,511| 16,166,953          -2.95%
Dw                    12,210,720| 11,862,273          -2.85%
EstimatedCycles      110,100,851|107,085,555          -2.74%
I1mr                     196,301|    164,455         -16.22%
ILmr                       1,587|      1,575          -0.76%
Ir                    71,629,866| 69,690,807          -2.71%
L1hits                99,523,276| 96,794,870          -2.74%
LLhits                   785,872|    736,334          -6.30%
RamHits                  189,949|    188,829          -0.59%
TotalRW              100,499,097| 97,720,033          -2.77%

compile_demo_art::compile_group::iai_compile_to_proto with_setup_4:load_from_name(valley-of-spires)
Instructions: 50,430,429 (master) -> 49,010,890 (HEAD) : $$\color{lime}-2.81\%$$

Detailed metrics
Baselines:                master|       HEAD
D1mr                     372,252|    346,160          -7.01%
D1mw                     144,141|    125,702         -12.79%
DLmr                      32,410|     29,641          -8.54%
DLmw                      57,760|     71,142         +23.17%
Dr                    11,658,819| 11,316,450          -2.94%
Dw                     8,557,319|  8,303,687          -2.96%
EstimatedCycles       75,991,935| 74,032,487          -2.58%
I1mr                     132,469|    111,733         -15.65%
ILmr                       1,494|      1,453          -2.74%
Ir                    50,430,429| 49,010,890          -2.81%
L1hits                69,997,705| 68,047,432          -2.79%
LLhits                   557,198|    481,359         -13.61%
RamHits                   91,664|    102,236         +11.53%
TotalRW               70,646,567| 68,631,027          -2.85%

Copy link

Found Clippy warnings

Clippy Warnings/Errors

warning: large size difference between variants
   --> node-graph/graph-craft/src/document/value.rs:27:3
    |
27  | /         pub enum TaggedValue {
28  | |             None,
29  | |             $( $(#[$meta] ) *$identifier( $ty ), )*
    | |                              ------------------ the largest variant contains at least 696 bytes
30  | |             RenderOutput(RenderOutput),
    | |             -------------------------- the second-largest variant contains at least 216 bytes
...   |
33  | |             EditorApi(Arc<WasmEditorApi>)
34  | |         }
    | |_________^ the entire enum is at least 0 bytes
...
115 | / tagged_value! {
116 | |     String(String),
117 | |     U32(u32),
118 | |     U64(u64),
...   |
180 | |     FontCache(Arc<graphene_core::text::FontCache>),
181 | | }
    | |_- in this macro invocation
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#large_enum_variant
    = note: `-W clippy::large-enum-variant` implied by `-W clippy::all`
    = help: to override `-W clippy::all` add `#[allow(clippy::large_enum_variant)]`
    = note: this warning originates in the macro `tagged_value` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider boxing the large fields to reduce the total size of the enum
    |
177 |     VectorModification(Box<graphene_core::vector::VectorModification>),
    |                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

warning: `graph-craft` (lib) generated 1 warning
warning: `graph-craft` (lib) generated 1 warning (1 duplicate)
warning: `graph-craft` (lib test) generated 1 warning (1 duplicate)
    Finished `dev` profile [optimized + debuginfo] target(s) in 4m 43s

@Keavon Keavon merged commit e352c7f into master Sep 20, 2024
4 checks passed
@Keavon Keavon deleted the node_fn_rework branch September 20, 2024 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants