Better profiling for memory usage.

Open
#1,046 0 comments 2 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Quiet
Domain
performance

Research direction

The issue discusses profile-dump-html, cost centers, and object counts, but names no source files or tests. Start by reading the profiling and allocation documentation and locating the implementation behind profile-dump-html; determine whether allocation data can be collected per form before proposing an approach. Done means the profiler can report inclusive and exclusive allocation costs, or accurate pre-collection object counts, with a test showing the reported values.

Written by the indexing model from the issue text.

Description

Continuing work on my soft-real-time project, a video game, and it's been a bit of stumbling around blindly trying to figure find where allocations are coming from and getting rid of them.

Prior considered solutions:

  1. Cost centers: They can track the total amount of allocation caused by the enclosed thunk, but this tracking is only granular up to that thunk. To drill down deeper, you have to manually move around the boundaries of the cost center in code and restart testing each time. This also only gives you a byte count, no information about what kinds of objects are allocated.
  2. object-counts: This lets you know what kinds of objects are allocated, but it is only accurate after a collection. Therefore, it can't be used to find allocations of short-lived objects.

Request:
A UI like the profile-dump-html UI that instead of highlighting form invocation counts, highlights each form with how many allocations/how much that form allocated. Ideally both "inclusive" cost (all subforms recursively part of that form) and "exclusive" cost (inherent in that form without considering subforms) are accounted for. Even better, if the allocation counts have a breakdown by object type.

Failing that, some way of getting accurate object-counts before a collection, so I can "diff" that with the post-collection object-counts to determine what kinds of objects were most allocated.

If this seems useful, I'd be down to implement it, though I'd probably need quite a bit of guidance.

Dominant language
Scheme
Stars
7.4k
Forks
1k
Avg merge
1d 20h
Merged PRs (30d)
19

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from cisco/ChezScheme

All issues in cisco/ChezScheme

Similar issues

More Performance issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.