Skip to content

Pharo io a8 at ohne block - #30

Merged
noha merged 3 commits into
mainfrom
pharo-io-a8-at-ohne-block
Nov 30, 2026
Merged

noha merged 3 commits into
mainfrom
pharo-io-a8-at-ohne-block

Conversation

@noha

@noha noha commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

No description provided.

noha and others added 3 commits November 30, 2026 12:12
… is not there

variableAt:, segmentAndMethodForResource:andOperation: and segmentsForResourceType:
signal KeyNotFound, and the key they name is the variable name, the pair of
segment and operation, and the class. The tests say so before the three methods
are changed to read their dictionaries without a block.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Dictionary>>#at: is ^ self at: key ifAbsent: [ ... ] and allocates a closure and
its context on each call, 232 bytes, also when the key is there. cheapAt: reads the
array of associations the way Dictionary>>#at:ifAbsent: does and reports a missing
key the way at: does.

Collection answers cheapAt: with at:, so that it is right wherever at: stands today.
MethodDictionary and WeakValueDictionary keep their values apart from the
associations and override at:ifAbsent:; they get the same fallback of their own, so
the cheap reading does not reach them.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
variableAt:, segmentAndMethodForResource:andOperation: and segmentsForResourceType:
read a dictionary whose key must be there. A missing key is a mistake in the route or
the uri space and stays loud: the three keep signalling KeyNotFound with the same key.
They no longer allocate the block of Dictionary>>#at: on each call: 105 003 calls
and 232 to 264 bytes each while a list of 3 000 rows builds its links.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@noha
noha merged commit a470af1 into main Nov 30, 2026
4 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.

1 participant