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

comparing to #embed #3

Closed
johannes-graeter opened this issue Dec 12, 2023 · 3 comments
Closed

comparing to #embed #3

johannes-graeter opened this issue Dec 12, 2023 · 3 comments

Comments

@johannes-graeter
Copy link

Hi,

thanks for the great work!
C23 added #embed https://en.cppreference.com/w/c/preprocessor/embed do you some benchmark that compares this to your lib? Any insight on when to use yours or #embed?

Best, Johannes

@MKlimenko
Copy link
Owner

Hi Johannes,

Personally, I'd use the standard way, that way you'll get rid of an extra step in the build procedure.
However, looks like no compiler supports #embed so far, but I haven't been following that lately. Some sort of custom trunk was once live on Compiler Explorer, but it might be down now.

My library was inspired by std::embed proposal of the same author, but (long story short) this functionality landed in plain C first. Therefore, I designed it to be a resourse- rather than an array of bytes-oriented to be more C++ish.

It worked pretty well on my previous job for storing the binary images of the heterogeneous device programs, we integrated it into CMake as a pre-build step, so as a conclusion I'd say that it's pretty straightforward tool to use until we have a standard way.

@johannes-graeter
Copy link
Author

Oh yeah you are right no compiler support for it currently. Although there is an active PR in Clang so perhaps we'll get it soon. llvm/llvm-project#68620
In the mean time l will happily employ yours :)

@MKlimenko
Copy link
Owner

It's a good idea to compare the performance against the native embed, and probably even create a PR with some performance improvement.
I'll do it once this support lands in Clang, but let me close this issue for now.

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

No branches or pull requests

2 participants