[squeak-dev] Question about inlining | How to access named temps in FullBlockClosure?
tim at rowledge.org
Mon Mar 30 17:42:31 UTC 2020
> On 2020-03-30, at 10:36 AM, Levente Uzonyi <leves at caesar.elte.hu> wrote:
> Try this instead:
> | regex |
> regex := 'to\:[\s\r\n]*\w+[\s\r\n]*do\:[\s\r\n]*\[[^\]]*\[' asRegex.
> CurrentReadOnlySourceFiles cacheDuring: [
> SystemNavigation default browseAllSelect: [ :method |
> regex search: method getSource asString ] ].
> The key differences are:
> - caching source files (as Nicolas suggested)
> - converting the source to String from Text (regex is intended to work with Strings not Texts)
> - using #search: instead of #matches:
> This brings down the runtime to 2.5 seconds on my machine.
And a smidge over 10 sec on my Pi 4 :-)
tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
A computer program does what you tell it to do, not what you want it to do.
More information about the Squeak-dev