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

Replace macro with run-time string concatenation #3124

Merged
merged 9 commits into from
Jan 10, 2025

Conversation

alexcristici
Copy link
Collaborator

@alexcristici alexcristici commented Jan 8, 2025

Follow-up on #3089.

Copy link

github-actions bot commented Jan 8, 2025

Bloaty Results 🐋

Compared to main

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  [ = ]       0  [ = ]       0    TOTAL

Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/bloaty-results/pr-3124-compared-to-main.txt

Compared to d387090 (legacy)

    FILE SIZE        VM SIZE    
 --------------  -------------- 
   +31% +36.1Mi  +438% +26.2Mi    TOTAL

Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/bloaty-results/pr-3124-compared-to-legacy.txt

Copy link

github-actions bot commented Jan 8, 2025

Benchmark Results ⚡

Benchmark                                                     Time             CPU      Time Old      Time New       CPU Old       CPU New
------------------------------------------------------------------------------------------------------------------------------------------
OVERALL_GEOMEAN                                            +0.0194         +0.0190             0             0             0             0

Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/benchmark-results/pr-3124-compared-to-main.txt

@alexcristici alexcristici marked this pull request as ready for review January 8, 2025 21:10
@louwers
Copy link
Collaborator

louwers commented Jan 8, 2025

Nice, thanks! I contacted the author of the code snippet. I'll update the PR with the license.

Copy link

github-actions bot commented Jan 8, 2025

Bloaty Results (iOS) 🐋

Compared to main

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  -0.2% -32.0Ki  -0.2% -32.0Ki    TOTAL

Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/bloaty-results-ios/pr-3124-compared-to-main.txt

Copy link
Collaborator

@louwers louwers left a comment

Choose a reason for hiding this comment

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

Bloaty results came back. Seems like it's not optimizing out the unused strings. So this is probably not worth it after all unless we find another approach. What do you think?

@alexcristici
Copy link
Collaborator Author

Bloaty results came back. Seems like it's not optimizing out the unused strings. So this is probably not worth it after all unless we find another approach. What do you think?

That's a big increase in size. I will try to concatenate them in the cpp, maybe this will help?

@louwers
Copy link
Collaborator

louwers commented Jan 10, 2025

Interesting, so now it's a size reduction.

Copy link
Collaborator

@louwers louwers left a comment

Choose a reason for hiding this comment

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

Now the concatenation happens at runtime. Probably minimal performance impact?

@alexcristici
Copy link
Collaborator Author

Now the concatenation happens at runtime. Probably minimal performance impact?

Yes, no noticeable differences.

@alexcristici alexcristici changed the title Replace macro with compile-time string Replace macro with run-time string concatenation Jan 10, 2025
@louwers louwers enabled auto-merge (squash) January 10, 2025 12:55
@louwers louwers merged commit 9f02e29 into maplibre:main Jan 10, 2025
50 checks passed
@alexcristici alexcristici deleted the compile-time-string branch January 14, 2025 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Replace macro with compile-time string in include/mbgl/shaders/mtl/collision.hpp
4 participants