[Vm-dev] how to print to stdout in plugin code

Robert Withers robert.withers at pm.me
Wed Jun 16 16:26:49 UTC 2021


I still do not know how I could print debug info to stdout, in a Squeak Plugin primitive. Hopefully I'll learn. This would be such a blessing! Please guide me!

In the meantime, I have written all GF methods as primitives, including #decode:twoS:, #runEuclideanAlgorithm adn #dividePoly:, though these 3 are not being called from the DecoderWithPlugin or GFPolyWithPlugin. The only new primitive is GFPoly>>#initializeFiled:coefficients:. Here are the numbers, with RSFEC Tests only.

---

> WITH RSPlugin {RSFEC Tests}
>
> - 47765 tallies, 61320 msec.
>
> Overall performance increase with and without RSPlugin: 54%
> ((116473 - 53364) / 116473) asFloat * 100 54.183372970559695
>
> Total WITH RSPlugin rates
> (13687 + 14730 + 24947) 53364
>
> Without RSPlugin 116473
>
> RSFEC 53%
> ((13687 + 14730)/ 53364) asFloat * 100 53.25125552807136
> Numerical 47%
> (24947 / 53364) asFloat * 100 46.748744471928646
>
> **Leaves**
> Unpluginized
> (12303 + 1384) 13687
> 20.1% {12303ms} RSFECDecoderWithPlugin>>decode:twoS:
> 2.3% {1384ms} RSFECDecoderWithPlugin>>runEuclideanAlgorithmPoly:poly:rDegrees:
>
> Pluginized
> (7532 +2877 + 2262 + 1200 + 859) 14730
> 12.3% {7532ms} RSFECGenericGFPoly class>>newField:coefficients:
> 4.7% {2877ms} RSFECDecoderWithPlugin>>primFindErrorLocationsDegree:coefficients:fieldSize:
> 3.7% {2262ms} RSFECGenericGFPolyWithPlugin>>addOrSubtractPoly:
> 2.0% {1200ms} RSFECDecoderWithPlugin>>findErrorMagnitudes:errorLocations:
> 1.4% {859ms} RSFECGenericGFWithPlugin>>log:
>
> Numerical
> (4269 + 3571 + 2909 + 2820 + 2093 + 1602 + 1578 + 1530 + 1383 + 877 + 847 + 815 + 653) 24947
> 7.0% {4269ms} LargePositiveInteger(Integer)>>bitShift:
> 5.8% {3571ms} SecureHashAlgorithm>>finalHash
> 4.7% {2909ms} ByteArray class(Behavior)>>new:
> 4.6% {2820ms} LargePositiveInteger>>+
> 3.4% {2093ms} IdentityDictionary(Dictionary)>>at:ifAbsent:
> 2.6% {1602ms} ByteSymbol(Object)>>->
> 2.6% {1578ms} WeakIdentityKeyDictionary(WeakKeyDictionary)>>at:ifAbsent:
> 2.5% {1530ms} SecureHashAlgorithm>>hashInteger:seed:
> 2.3% {1383ms} SecureRandom>>nextRandom160
> 1.4% {877ms} SmallInteger(Magnitude)>>between:and:
> 1.4% {847ms} ByteArray>>unsignedLongAt:put:bigEndian:
> 1.3% {815ms} [] Delay>>wait
> 1.1% {653ms} SmallInteger(Integer)>>timesRepeat:

--
---
Kindly,
Robert
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20210616/694b5683/attachment.html>


More information about the Vm-dev mailing list