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

Make de-generics wrappers for open and save_buffer #518

Merged
merged 1 commit into from Mar 31, 2016

Conversation

@bluss
Copy link
Contributor

@bluss bluss commented Mar 30, 2016

This makes the inner parts of these functions non-inlinable. It also
makes open_impl and save_buffer_impl be compiled once, as part of
compiling the crate, instead of having to compile them each time their
uses are compiled.

This was prompted by http://stackoverflow.com/questions/36317461/

Modifying the user library and recompiling took more than 20 seconds,
with this change, only < 0.3 s. This means that open's implementation
may no longer be inlined, but it shouldn't matter.

This makes the inner parts of these functions non-inlinable. It also
makes open_impl and save_buffer_impl be compiled once, as part of
compiling the crate, instead of having to compile them each time their
*uses* are compiled.
@bluss
Copy link
Contributor Author

@bluss bluss commented Mar 30, 2016

libstd uses this “pattern” in a few places too.

@bluss
Copy link
Contributor Author

@bluss bluss commented Mar 30, 2016

load could use the same kind of transformation I think, but you that know the library well need to make the call there.

@bvssvni
Copy link
Contributor

@bvssvni bvssvni commented Mar 31, 2016

Nice!

@bvssvni bvssvni merged commit 2e2e36d into image-rs:master Mar 31, 2016
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@bluss bluss deleted the bluss:degeneric branch Mar 31, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.