Skip to content

More misc optimizations fdkslrfewl#2019

Merged
andrew4328 merged 8 commits intoLambda-Mountain-Compiler-Backend:mainfrom
andrew4328:more-misc-optimizations-fdkslrfewl
Mar 29, 2026
Merged

More misc optimizations fdkslrfewl#2019
andrew4328 merged 8 commits intoLambda-Mountain-Compiler-Backend:mainfrom
andrew4328:more-misc-optimizations-fdkslrfewl

Conversation

@andrew4328
Copy link
Copy Markdown
Collaborator

@andrew4328 andrew4328 commented Mar 28, 2026

Describe your changes

Features:

  • add ability to count type allocations to profile memory usage
  • lots of type allocations (potentially, hard to get rid of)
  • lots of U8, and S allocations (no idea why this is so high)

Issue ticket number and link

#1895

Checklist before requesting a review

  • [ x ] I have performed an AI-assisted self-review of my code.
Can you review my pull request and provide some suggestions?
https://patch-diff.githubusercontent.com/raw/Lambda-Mountain-Compiler-Backend/lambda-mountain/pull/1926.diff
  • [ x ] If it is a new feature, I have added thorough tests.
  • [ x ] I agree to release these changes under the terms of the permissive MIT license (1).
  1. https://github.com/andrew-johnson-4/lambda-mountain/blob/main/LICENSE
Total blocks allocated: 100111953
Allocation Counts
OwnedData<Type> : 28726625
SparseOwnedData<Tuple<List<Tuple<AST,Type,Type>>,C<"char">[],HashtableRowExists>> : 2
OwnedData<U8> : 28386828
SparseOwnedData<Tuple<AST,Tuple<U64,C<"char">[]>,HashtableRowExists>> : 2
OwnedData<List<Tuple<Type,C<"char">[]>>> : 1505
OwnedData<List<CTerm>> : 11336
OwnedData<CTerm> : 3832
SparseOwnedData<Tuple<Vector<TypeContextRow>,C<"char">[],HashtableRowExists>> : 7
OwnedData<Tuple<AST,Type,C<"char">[],Maybe<TypeContext>>> : 28
OwnedData<List<ASTOrIdent>> : 474
OwnedData<FContext> : 771307
OwnedData<TypeContextRow> : 1650103
OwnedData<List<Tuple<AST,Type>>> : 48688
SparseOwnedData<Tuple<Bool,Tuple<U64,C<"char">[]>,HashtableRowExists>> : 5
OwnedData<Tuple<Vector<Tuple<Type,C<"char">[]>>,C<"char">[]>> : 43
OwnedData<List<Tuple<Type,Maybe<TypeContext>>>> : 1037
SparseOwnedData<Tuple<Bool,Type,HashtableRowExists>> : 10
OwnedData<AST> : 5637494
SparseOwnedData<Tuple<Bool,Sized<AST>,HashtableRowExists>> : 11
OwnedData<S> : 21188626
OwnedData<List<Tuple<AST,Type,Type>>> : 13
SparseOwnedData<Tuple<String,U64,HashtableRowExists>> : 6
SparseOwnedData<Tuple<Arrow<Nil,Nil>[],C<"char">[],HashtableRowExists>> : 1
U8 : 9064793
OwnedData<List<Tuple<AST,C<"char">[]>>> : 272369
SparseOwnedData<Tuple<Vector<Type>,Tuple<U64,C<"char">[]>,HashtableRowExists>> : 2
OwnedData<Tuple<Type,C<"char">[]>> : 72
SparseOwnedData<Tuple<Bool,Tuple<Type,C<"char">[]>,HashtableRowExists>> : 17
SparseOwnedData<Tuple<Vector<Tuple<Type,Type>>,Tuple<U64,C<"char">[]>,HashtableRowExists>> : 10
OwnedData<List<Tuple<U64,C<"char">[]>>> : 2245
SparseOwnedData<Tuple<AST,Sized<AST>,HashtableRowExists>> : 14
OwnedData<Tuple<Type,Type>> : 333
OwnedData<List<AST>> : 383
SparseOwnedData<Tuple<Bool,C<"char">[],HashtableRowExists>> : 8
SparseOwnedData<Tuple<Type,Tuple<U64,C<"char">[]>,HashtableRowExists>> : 1
SparseOwnedData<Tuple<Type,C<"char">[],HashtableRowExists>> : 20855
OwnedData<MacroList> : 47
SparseOwnedData<Tuple<Fragment,Sized<AST>,HashtableRowExists>> : 11
SparseOwnedData<Tuple<Tuple<Type,Type>,Tuple<U64,C<"char">[]>,HashtableRowExists>> : 2
SparseOwnedData<Tuple<Bool,String,HashtableRowExists>> : 10
OwnedData<List<TypeContextRow>> : 3110301
OwnedData<List<String>> : 145981
SparseOwnedData<Tuple<Arrow<C<"char">[],Nil>,C<"char">[],HashtableRowExists>> : 1
SparseOwnedData<Tuple<U64,Tuple<C<"char">[],U64,C<"char">[]>,HashtableRowExists>> : 4
OwnedData<List<C<"char">[]>> : 2
OwnedData<Maybe<List<CTerm>>> : 454
OwnedData<Tuple<AST,C<"char">[]>> : 10160
SparseOwnedData<Tuple<Type,Sized<AST>,HashtableRowExists>> : 45
OwnedData<List<Token>> : 145981
OwnedData<List<Tuple<S,C<"char">[]>>> : 739831
OwnedData<StackToSpecialize> : 22
C<"char"> : 169076
OwnedData<Maybe<CTerm>> : 952

@andrew4328 andrew4328 merged commit 47d8542 into Lambda-Mountain-Compiler-Backend:main Mar 29, 2026
1 check failed
@andrew4328 andrew4328 deleted the more-misc-optimizations-fdkslrfewl branch March 29, 2026 15:09
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.

1 participant