Skip to content

<table> implementation improvements - #1822

Merged
cgay merged 2 commits into
dylan-lang:masterfrom
housel:table-improvements-202606
Jun 24, 2026
Merged

<table> implementation improvements#1822
cgay merged 2 commits into
dylan-lang:masterfrom
housel:table-improvements-202606

Conversation

@housel

@housel housel commented Jun 23, 2026

Copy link
Copy Markdown
Member

No description provided.

housel added 2 commits June 23, 2026 08:14
* sources/dylan/table.dylan ($entry-counts): Replace the sequence of
  primes used for table vector growth target sizes with a faster-growing
  one that allows more entries (463_830_313 vs 9_562_387).
* sources/dylan/table.dylan
  (search-for-entry-count, compute-entry-count): Mark elements
   retrieved from the $entry-counts constant vector as integer
   using primitive-the to improve dispatch performance.
Comment thread sources/dylan/table.dylan
// needed number of entries.
if (lower = upper)
vector-element($entry-counts, lower);
primitive-the(<integer>, vector-element($entry-counts, lower))

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.

Just curious, couldn't this also be achieved by making $entry-counts be a limited(<vector>, of: <integer>)?

@housel housel Jun 24, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Just curious, couldn't this also be achieved by making $entry-counts be a limited(<vector>, of: <integer>)?

Not quite as easily, you'd have to initialize it with as(limited(<vector>, of: <integer>), #[...]) which would have an initialization-time cost. I don't think the compiler can do the conversion at compile time (yet).

@cgay
cgay merged commit d719b21 into dylan-lang:master Jun 24, 2026
3 checks passed
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.

2 participants