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

type-contract: add common ctc-cache #917

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bennn
Copy link
Contributor

@bennn bennn commented Mar 27, 2020

Make a cache at the top of mb-core and share it across all passes that might generate contracts.

Make a cache at the top of `mb-core` and share it across all passes
 that might generate contracts.
@samth
Copy link
Sponsor Member

samth commented Apr 13, 2020

Can you evaluate this somehow? For example, how often do we hit this cache? How often do we miss? Is there a performance impact?

@bennn
Copy link
Contributor Author

bennn commented Apr 23, 2020

Here's a small evaluation. So far, looks like this cache
does not help much.

First, I measured compile times for the tr-performance
programs. Times are within the noise before & after the cache.

Second, I measured zo sizes for tr-performance and the
programs in #917. A few programs do a little better --- task-6
from 7GUI saves 20KB if I'm interpreting the ls -l output
correctly --- but most are the same before & after.

I'm inclined to close this PR for now and take a closer look
later, for my upcoming "transient" pull request. That adds
a new contract-making pass & should give a stronger signal
about whether this is a good idea.

compile time

benchmark master share-cache
acquire 15.44 (σ 0.06) 15.53 (σ 0.1)
bernoulli 3.85 (σ 0.07) 3.9 (σ 0.04)
dungeon 7.32 (σ 0.06) 7.36 (σ 0.04)
forth 4.6 (σ 0.07) 4.61 (σ 0.13)
fsm 4.96 (σ 0.04) 4.97 (σ 0.03)
math-flonum 3.79 (σ 0.02) 3.8 (σ 0.02)
new-metrics 4.1 (σ 0.03) 4.11 (σ 0.02)
old-metrics 2.68 (σ 0.03) 2.67 (σ 0.02)
parser 2.33 (σ 0.02) 2.34 (σ 0.01)
schml-interp-casts-help 22.32 (σ 0.4) 22.45 (σ 0.12)
schml-specify-rep 8.53 (σ 0.05) 8.53 (σ 0.07)

zo size

benchmark master share-cache
acquire 1.5M 1.5M
bernoulli 248K 248K
dungeon 496K 496K
forth 340K 336K
fsm 364K 364K
math-flonum 172K 172K
new-metrics 168K 168K
old-metrics 68K 68K
parser 56K 56K
schml-interp-casts-help 2.4M 2.4M
schml-specify-rep 740K 740K
------------------------- ---------------- ----------------
plot2d.rkt 75774B 75765B
plot3d.rkt 83573B 83564B
task-1.rkt 80886B 80888B
task-2.rkt 83109B 83108B
task-3.rkt 93582B 93584B
task-4.rkt 81577B 81575B
task-5.rkt 113172B 113169B
task-6.rkt 783436B 759673B
task-7.rkt 107778B 107780B
gui-types.rkt 159918B 160127B
framework-types.rkt 278388B 273291B
framework.rkt 228828B 228828B
gui/base.rkt 151591B 151591B
pict.rkt 72925B 72925B
http.rkt 353170B 353161B

@samth
Copy link
Sponsor Member

samth commented Apr 23, 2020

I think we need to finish #633 and then see how this impacts things.

@samth samth self-assigned this Jul 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants