Skip to content
This repository was archived by the owner on Sep 12, 2018. It is now read-only.

Arc, refactored#659

Merged
rnewman merged 6 commits into
masterfrom
rnewman/arc
Apr 25, 2018
Merged

Arc, refactored#659
rnewman merged 6 commits into
masterfrom
rnewman/arc

Conversation

@rnewman
Copy link
Copy Markdown
Collaborator

@rnewman rnewman commented Apr 25, 2018

Informally I don't see significant performance differences with this. More timing to do; you can switch between Rc and Arc by switching the commenting for a few lines in types.rs.

This PR is like #656 but reproduced independently on top of #658. There are a few changes that should go into #658, and not all the code builds yet, but cargo test -p mentat --test query will run.

Copy link
Copy Markdown
Member

@ncalexan ncalexan left a comment

Choose a reason for hiding this comment

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

I don't have strong feelings about this. If this is the way that one abstracts over the reference type, I'm fine with it. (I definitely don't want everything to be generic over a new R type!)

Comment thread core/src/types.rs Outdated
}

//
// Use Rc for values.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This comment isn't great. At first I thought it was just wrong, but now I see that this isn't an alias, it's picking one of Rc<T> and the implicitly not chosen Arc<T>.

@rnewman
Copy link
Copy Markdown
Collaborator Author

rnewman commented Apr 25, 2018

Comments improved, FFI works, and we can now use Box, Rc, and Arc.

@fluffyemily, please post-review a6ec3f2 if this lands during your nighttime.

Our test times are incredibly stable, with no variance visible between the types.

Box:

cargo test -p mentat  14.38s user 13.03s system 172% cpu 15.888 total

Rc:

cargo test -p mentat  14.43s user 13.03s system 173% cpu 15.858 total

Arc:

cargo test -p mentat  14.43s user 12.97s system 172% cpu 15.854 total

@rnewman rnewman merged commit f979044 into master Apr 25, 2018
@rnewman rnewman self-assigned this Apr 25, 2018
ncalexan added a commit to ncalexan/mentat that referenced this pull request May 3, 2018
)

@mmacedoeu did a good deal of work to show that Arc instead of Rc
wasn't too difficult in mozilla#656, and @rnewman pushed the refactoring
across the line in mozilla#659. However, we didn't flip the switch at that
time. For mozilla#673, we'd like to include TypedValue instances in errors,
and with error-chain (and failure) error types need to be 'Sync +
'Send, so we need Arc.

This builds on mozilla#659 and should also finish mozilla#656.
rnewman pushed a commit that referenced this pull request May 3, 2018
) r=rnewman

@mmacedoeu did a good deal of work to show that Arc instead of Rc
wasn't too difficult in #656, and @rnewman pushed the refactoring
across the line in #659. However, we didn't flip the switch at that
time. For #673, we'd like to include TypedValue instances in errors,
and with error-chain (and failure) error types need to be 'Sync +
'Send, so we need Arc.

This builds on #659 and should also finish #656.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants