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 to 0.8 #17

Merged
merged 31 commits into from Jul 12, 2020
Merged

Update to 0.8 #17

merged 31 commits into from Jul 12, 2020

Conversation

Robbepop
Copy link
Owner

This mainly utilizes Pin for the StringInterner self-referencing and rebuilds performance tests.

@coveralls
Copy link

coveralls commented Mar 22, 2020

Coverage Status

Coverage increased (+1.2%) to 96.126% when pulling fd8e7ec on update-to-0.8 into 6856233 on master.

impl PartialEq for InternalStrRef {
fn eq(&self, other: &InternalStrRef) -> bool {
impl PartialEq for PinnedStr {
fn eq(&self, other: &Self) -> bool {
self.as_str() == other.as_str()
Copy link

Choose a reason for hiding this comment

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

Why do you need to dereference the pointer here? I thought string-interner guarentees that two strings will always return the same Symbol, so shouldn't they have the same pointer as well?

Copy link
Owner Author

@Robbepop Robbepop Mar 29, 2020

Choose a reason for hiding this comment

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

Good question! You can generally treat same symbols as being the same string. However, for the string interners internal hash map you need to compare incoming strings using their contents since they will probably not point to strings stored in the string interner and thus will have different pointers to potentially equal string contents.

Note that PinnedStr != Symbol.
PinnedStr is a pointer or identifier for internal access while Symbol is an identifier for external access.

Copy link

Choose a reason for hiding this comment

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

Ok, so a PinnedStr may not yet have been deduplicated? That makes sense.

@jyn514
Copy link

jyn514 commented May 14, 2020

Any progress on this PR? It would be great to no longer have undefined behavior due to the self-referencing structs ...

@Robbepop
Copy link
Owner Author

Robbepop commented May 15, 2020

Any progress on this PR? It would be great to no longer have undefined behavior due to the self-referencing structs ...

From my understanding there is no UB in the current implementation of string_interner. There have been some past releases with UB but those have been yanked. To answer your question: The rewrite is actually done in this PR, however, I also wanted to rewrite and update the benchmarks and never finished with it unfortunately. Maybe I remove this part from the PR again and simply go with the old benchmarks.

@codecov-commenter
Copy link

codecov-commenter commented Jul 12, 2020

Codecov Report

Merging #17 into master will increase coverage by 1.69%.
The diff coverage is 93.75%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #17      +/-   ##
==========================================
+ Coverage   94.44%   96.13%   +1.69%     
==========================================
  Files           2        4       +2     
  Lines         414      414              
==========================================
+ Hits          391      398       +7     
+ Misses         23       16       -7     
Impacted Files Coverage Δ
src/symbol.rs 84.61% <84.61%> (ø)
src/lib.rs 93.63% <86.95%> (+5.04%) ⬆️
src/iter.rs 100.00% <100.00%> (ø)
src/tests.rs 97.36% <100.00%> (-0.37%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6856233...863b868. Read the comment docs.

@Robbepop Robbepop merged commit cdaf276 into master Jul 12, 2020
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