1

I am feeling the dopamine high from finally finishing (mostly) my Reed Solomon implementation. I got decoding working correctly, with dataMatrix256 and QRCode, including corruption repair, within t/2 errors. It is VERY SLOOOW, way to slow to use yet. There are speedups possible in writing a plugin for the hot spots, which are on the decode side: GFPoly evaluateAt (40.1%), Decoder runEuclideanAlgorithm(38.5%), Decoder findErrorLocations(12.6%) and Decoder find ErrorMagnitudes(2.3%).

It is written in Squeak, my favorite all-time language environment. I have used it for over 20 years. It is so beautiful! The rule of development is #GetItWorking, #GetItWorkingRight #GetItWorkingFast.

If you are interested in checking out the code, go to http://squeak.org and grab squeak. Once you have it running, right click for the World Menu and select open...Monticello Browser. Add a new repository of type HTTP and enter the Cryptography repository.

MCHttpRepository
    location: 'https://www.squeaksource.com/Cryptography'
    user: 'squeak'
    password: 'squeak'

Open a Workspace (World Menu -> Workspace) & run this code (paste into Workspace, select it and right click do it.):

Installer ss
    project: 'Cryptography';
    install: 'ProCrypto-1-1-1';
    install: 'ProCryptoTests-1-1-1'.

Now you can open a Browser to look at the code (categories: CryptographyRSFEC & CryptographyRSFECTests) or open a TestRunner to test it (World Menu -> *).


Speedup work: I converted OrderedCollection use to Array use to improve #at: lookup and #at:put: set calls. Code is published to Cryptography. OrderedCollection has fallen off the leaves, from profiling. Plugin support is next.

**Leaves**
16.5% {22153ms} RSFECGenericGF>>exp:
9.6% {12888ms} RSFECGenericGF>>maskValue:
9.1% {12205ms} RSFECGenericGF>>addOrSubtract:by:
7.1% {9561ms} RSFECGenericGF>>log:
6.5% {8694ms} RSFECGenericGF>>normalizeIndex:
4.7% {6299ms} RSFECGenericGF>>multiply:by:
2.6% {3512ms} RSFECGenericGFPoly>>evaluateAt:
1.3% {1780ms} RSFECGenericGFPoly>>addOrSubtractPoly:
1.3% {1682ms} RSFECGenericGFPoly>>multiplyByMonomialDegree:coefficient:

6.0% {8097ms} RSErasureGalois>>normalizeIndex:
1.7% {2336ms} RSErasureGalois>>maskValue:
1.6% {2140ms} RSErasureGalois>>tableMultiply:by:
1.5% {2040ms} RSErasureGalois>>add:by:
1.3% {1797ms} RSErasureGaloisTest(TestCase)>>assert:description:
1.2% {1669ms} RSErasureGalois>>galoisMultiply:by:
rabbit
  • 111
  • 9
  • What is the question you are trying to ask? – JayK May 26 '21 at 22:29
  • Cross-Translated C code for the plugins: https://www.dropbox.com/s/uk1dcd0akj4dvx7/RSErasurePlugin.c?dl=0 https://www.dropbox.com/s/a1trk3w3be9irmm/RSFECPlugin.c?dl=0 – rabbit May 27 '21 at 17:41
  • Cross-Translated Squeak Smalltalk source code for the plugins: [3] https://www.dropbox.com/s/ui2v9fwf2oj2sk2/RSErasurePlugin.st?dl=0 [4] https://www.dropbox.com/s/l76k8yq7cpjnodc/RSFECPlugin.st?dl=0 – rabbit May 27 '21 at 17:44
  • Squeak Smalltalk Adaptors providing the same protocols from the in-image class for Galois Fields, and calling the plugin in prim* methods, including GFPoly primitives. [5] https://www.dropbox.com/s/7sq0hbinkr594op/RSErasureGaloisWithPlugin.st?dl=0 [6] https://www.dropbox.com/s/6irdhbk29jlq8i7/RSFECGenericGFWithPlugin.st?dl=0 [7] https://www.dropbox.com/s/17q1uz2qa15fcfo/RSFECGenericGFPolyWithPlugin.st?dl=0 – rabbit May 27 '21 at 17:46
  • @JayK my question is how can I effectively speed up Squeak code for RSErasure and RSForwardErrorCorrection with plugins? – rabbit May 27 '21 at 17:49
  • That's great! Unfortunately I cannot help you with plugin development insights. However, StackOverflow wants questions to be focused and to-the-point, so I suggest you edit yours to make your actual question more obvious to find. Also it is customary to post the code in the question itself, not linked to a Dropbox (so people do not have to leave the page to understand the problem). Regarding your request for code review, this would be better suited on https://codereview.stackexchange.com/ (https://codereview.stackexchange.com/help/on-topic). – JayK May 27 '21 at 20:59
  • Also have a look at https://stackoverflow.com/help/on-topic – JayK May 27 '21 at 21:02
  • Whilst @JayK has recommended Code Review your question as-is would be off-topic as you haven't provided the code to users in a form the site recognizes. If you post on Code Review you _must_ include the code you want reviewed in the question. – Peilonrayz May 27 '21 at 21:39
  • Alright, I asked over in code review: https://codereview.stackexchange.com/questions/261315/asking-is-this-optimal-generated-c-code-for-pluginizing-gfmultiplyby-squea – rabbit May 28 '21 at 01:38

0 Answers0