[Cuis-dev] Slow execution
Luis Mendes
luisvmendes at yandex.com
Sat Oct 10 02:36:31 PDT 2026
Hi,
I'm evaluating Cuis as a programming language for my use.
Smalltalk seems like a great environment to program.
But I need that programs can execute fast.
I did some non-rigorous benchmark to some languages for a CPU intensive
operation.
The language that I've been using is Tcl. It's slow for some kind of
operations, and I will need a language that can go through lots of data.
Used Python just because it is so popular.
Used Euphoria because it's a simple language that runs fast. Faster
yet when translated to C, but I didn't test the speed after this
operation.
Also tested Icon because it's compiled, has great tools for text
related operations, and can also run on MS-DOS, as can Euphoria, in
case I decide to also use this focused environment to program.
For the Erathostenes code found on Rosettacode, these are the results I
got:
1.000.000 times milliseconds
eratosthenes2.eu 70
eratosthenes2.eu 90
eratosthenes_generator.py 114
eratosthenes_array.py 121
eratosthenes_set.py 253
eratosthenes.icn 700
eratosthenes_sets.icn 580
eratosthenes.tcl 2112
eratosthenes2.tcl 4792
cuis 5.0 2021 27472
cuis 7.9 2026 2093
squeak6.2 alpha 24031 66
The Smalltalk code used was this one:
| startTime elapsed potentialPrimes limit |
startTime := Time millisecondClockValue.
limit := 100.
potentialPrimes := Array new: limit.
potentialPrimes atAllPut: true.
2 to: limit sqrt floor do: [:testNumber |
(potentialPrimes at: testNumber) ifTrue: [
(testNumber squared) to: limit by: testNumber do: [:nonPrime |
potentialPrimes at: nonPrime put: false
]
]
].
2 to: limit do: [:testNumber |
(potentialPrimes at: testNumber) ifTrue: [
Transcript show: testNumber asString; cr
]
].
elapsed := Time millisecondClockValue - startTime.
Transcript show: elapsed printString; show: ' ms'; cr.
What I found is that printing the numbers in a window is very slow for
Cuis, maybe the difference is entirely related to it.
Something like 60-70 ms, like in Squeak would be great.
Any comments?
Thank you,
Luís Mendes
More information about the Cuis-dev
mailing list