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

Update object to 0.9.0 #93

Merged
merged 3 commits into from
Jun 11, 2018
Merged

Update object to 0.9.0 #93

merged 3 commits into from
Jun 11, 2018

Conversation

philipc
Copy link
Contributor

@philipc philipc commented Jun 2, 2018

Also use the Object trait instead of File (see gimli-rs/object#53).

This requires gimli-rs/gimli#305.

I played a bit with using Rc/Arc<Cow<'input, [u8]>> instead of EndianRcSlice, but wasn't sure it was worth the API complexity. So I think Context::new should be the simple high level interface, and consumers with more specific needs can use Context::from_sections.

Before:

test context_new_and_query_location       ... bench:     951,031 ns/iter (+/- 79,277)
test context_new_and_query_with_functions ... bench:   1,760,225 ns/iter (+/- 54,934)
test context_new_location                 ... bench:     760,223 ns/iter (+/- 57,231)
test context_new_with_functions           ... bench:     751,183 ns/iter (+/- 55,055)
test context_query_location               ... bench:  10,378,538 ns/iter (+/- 92,496)
test context_query_with_functions         ... bench:  11,578,429 ns/iter (+/- 142,557)

After:

test context_new_and_query_location       ... bench:   5,527,469 ns/iter (+/- 285,657)
test context_new_and_query_with_functions ... bench:   6,809,893 ns/iter (+/- 490,899)
test context_new_location                 ... bench:   5,230,294 ns/iter (+/- 307,209)
test context_new_with_functions           ... bench:   5,213,000 ns/iter (+/- 266,617)
test context_query_location               ... bench:  15,353,989 ns/iter (+/- 309,998)
test context_query_with_functions         ... bench:  16,591,755 ns/iter (+/- 402,449)

For reference, Arc<Cow<[u8]>>:

test context_new_and_query_location       ... bench:   1,063,159 ns/iter (+/- 57,010)
test context_new_and_query_with_functions ... bench:   2,483,267 ns/iter (+/- 180,353)
test context_new_location                 ... bench:     758,812 ns/iter (+/- 16,336)
test context_new_with_functions           ... bench:     755,755 ns/iter (+/- 31,252)
test context_query_location               ... bench:  18,362,107 ns/iter (+/- 417,995)
test context_query_with_functions         ... bench:  19,264,415 ns/iter (+/- 260,564)

The query numbers for Arc<Cow<[u8]>> are surprising to me, but I didn't look into it.

This was referenced Jun 2, 2018
@philipc philipc changed the title [WIP] Update object to 0.8.0 Update object to 0.9.0 Jun 7, 2018
@est31
Copy link
Contributor

est31 commented Jun 7, 2018

@philipc would you want to make a hacky experimental PR that builds on this one which has no_std support? Then I can start working on a prototype for libstd integration :).

@coveralls
Copy link

Coverage Status

Coverage increased (+0.8%) to 82.201% when pulling fc47630 on philipc:object into c1203c6 on gimli-rs:master.

@est31
Copy link
Contributor

est31 commented Jun 7, 2018

@philipc philipc requested a review from fitzgen June 10, 2018 09:11
Copy link
Member

@fitzgen fitzgen left a comment

Choose a reason for hiding this comment

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

Thanks!

@fitzgen fitzgen merged commit 93727de into gimli-rs:master Jun 11, 2018
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.

None yet

4 participants