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

More performance improvements #776

Merged
merged 27 commits into from
Sep 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
c2d14e5
refactor(check): Avoid unnecessary recursion
Marwes Aug 10, 2019
06ef80d
refactor(check): Generate more straightforward code for subsumption
Marwes Aug 10, 2019
da861eb
perf(check): Only add implicit fields if the binding is implicit
Marwes Aug 11, 2019
a7ac9f8
perf: Avoid computing the plain name in name_eq (-3%)
Marwes Aug 11, 2019
3d835a8
perf: Only mark types with unbound generics as HAS_GENERICS
Marwes Aug 13, 2019
89eb836
perf: Avoid recursion in implicits.rs
Marwes Aug 13, 2019
d69a52e
Unknown
Marwes Aug 13, 2019
4a3662e
perf(check): Avoid looking through metadata when checking for an impl…
Marwes Aug 13, 2019
de32dbd
perf: Avoid RefCell in Fixed* structurs (-1%)
Marwes Aug 14, 2019
a9c965b
perf(check): Narrow down the implicit parititioning further (-10%)
Marwes Aug 14, 2019
0ea13ff
perf(check): Only do one lookup/insertion on the implicit definition map
Marwes Aug 14, 2019
793b658
perf(check): Only initialize the variable generator when it is necess…
Marwes Aug 14, 2019
48a5313
perf(vm): Avoid tracing global values unless we are in the root gc (-7%)
Marwes Aug 14, 2019
178180f
perf: Shrink Type's size to 48 bytes (from 64)
Marwes Aug 15, 2019
c7061c7
perf(parser): Simplify tokenization iterators
Marwes Aug 16, 2019
3016f25
perf(parser): Shrink the Token type and remove it's need to Drop
Marwes Aug 16, 2019
a709c71
perf: Only do one hash lookup when creating a Symbol
Marwes Aug 16, 2019
78967bd
refactor(check): Simplify union
Marwes Aug 16, 2019
03e7c3b
perf(check): Remove some branches in the occurs check¨
Marwes Aug 16, 2019
5e4efe3
perf(check): No need to lookup the type again before querying the level
Marwes Aug 17, 2019
f3d4203
perf(check): Remove redundant operations in union
Marwes Aug 17, 2019
1244143
perf(check): Use RefCell::get_mut when possible
Marwes Aug 17, 2019
fa6ab66
refactor: Construct the more specific type during unification
Marwes Aug 17, 2019
6ce443a
Fix skolem unification ordering
Marwes Aug 17, 2019
7bf25e8
refactor(check): Replace the TailCall trampoline with a loop
Marwes Aug 17, 2019
045f2ed
Loop instead of recursion
Marwes Aug 17, 2019
32b1f82
Fix non 64-bit builds
Marwes Sep 2, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 21 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions base/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ travis-ci = { repository = "gluon-lang/gluon" }

[dependencies]
bitflags = "1"
hashbrown = "0.6"
log = "0.4"
quick-error = "1.0.0"
fnv = "1.0.3"
Expand Down
23 changes: 17 additions & 6 deletions base/src/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,10 @@ pub struct TypedIdent<Id = Symbol, T = ArcType<Id>> {
}

impl<Id> TypedIdent<Id> {
pub fn new(name: Id) -> TypedIdent<Id> {
pub fn new(name: Id) -> TypedIdent<Id>
where
Id: PartialEq,
{
TypedIdent {
typ: Type::hole(),
name,
Expand Down Expand Up @@ -543,7 +546,10 @@ pub struct ValueBinding<Id> {
pub expr: SpannedExpr<Id>,
}

impl<T> Default for ValueBinding<T> {
impl<T> Default for ValueBinding<T>
where
T: PartialEq,
{
fn default() -> Self {
ValueBinding {
metadata: Default::default(),
Expand Down Expand Up @@ -809,18 +815,23 @@ pub fn walk_ast_type<'a, V: ?Sized + $trait_name<'a>>(
Type::Effect(ref $($mut)* ast_type) => v.visit_ast_type(&$($mut)* ast_type._typ.typ),
Type::EmptyRow => (),
Type::ExtendRow {
ref $($mut)* types,
ref $($mut)* fields,
ref $($mut)* rest,
} => {
for field in fields {
v.visit_ast_type(&$($mut)* field.typ._typ.typ);
}
v.visit_ast_type(&$($mut)* rest._typ.typ);
}
Type::ExtendTypeRow {
ref $($mut)* types,
ref $($mut)* rest,
} => {
for field in types {
if let Some(alias) = field.typ.$try_get_alias() {
v.visit_ast_type(&$($mut)* alias.$unresolved_type()._typ.typ);
}
}
for field in fields {
v.visit_ast_type(&$($mut)* field.typ._typ.typ);
}
v.visit_ast_type(&$($mut)* rest._typ.typ);
}
Type::Alias(ref $($mut)* alias) => {
Expand Down
Loading