Re: [FAB-17598] Improve the efficiency of viperutil.EnhancedExactUnmarshal

Brett T Logan <brett.t.logan@...>

This Jira is to improve the overall performance of the EnhancedExactUnmarshal. You won't be able to reproduce the slow times anymore as a change was push to cache the result of the call to EnhancedExactUnmarshal and pull from that cache rather than unmarshal it every time. I can try to find the PR where those changes were made so you can see the caching mechanism.
I assume we would still want to improve the performance of this call as the cache is a workaround to the poor performance, but I'll defer to Matt on that question.
Brett Logan
Software Engineer, IBM Blockchain
Phone: 1-984-242-6890

----- Original message -----
From: "Nicholas Basker" <nbasker@...>
Sent by: fabric@...
To: fabric@...
Subject: [EXTERNAL] [Hyperledger Fabric] [FAB-17598] Improve the efficiency of viperutil.EnhancedExactUnmarshal
Date: Wed, May 20, 2020 10:06 AM
New comer to HL fabric, starting out by building, running and understanding the unit and integration tests. Picked the help-wanted JIRA issue below
Just took a sample set of the following tests peer.TestCreateChannel, genesisconfig.TestLoadProfile.func1. Tried to reproduce as shown below, it seems to be completing in milliseconds as opposed ~5seconds below. I tried doing "make unit-test" and "make integration-test" but unable to get the issue.
Possibly am missing something in my repro steps, any pointers on steps to repro would be helpful.
(Tried using the recommended method of TEST_PKGS=" unit-test, but the run was cached inspite of giving -count=1 in GO_TAGS, then resorted to the method below)

nb@~/Documents/$ go test -v | grep TestCreateChannel

=== RUN   TestCreateChannel

--- PASS: TestCreateChannel (0.29s)

nb@~/Documents/$ go test -v -count=1 | grep TestLoadProfile

=== RUN   TestLoadProfile

=== RUN   TestLoadProfile/SampleDevModeKafka

=== RUN   TestLoadProfile/SampleDevModeSolo

=== RUN   TestLoadProfile/SampleSingleMSPChannel

=== RUN   TestLoadProfile/SampleSingleMSPKafka

=== RUN   TestLoadProfile/SampleSingleMSPSolo

--- PASS: TestLoadProfile (0.35s)

    --- PASS: TestLoadProfile/SampleDevModeKafka (0.33s)

    --- PASS: TestLoadProfile/SampleDevModeSolo (0.00s)

    --- PASS: TestLoadProfile/SampleSingleMSPChannel (0.00s)

    --- PASS: TestLoadProfile/SampleSingleMSPKafka (0.00s)

    --- PASS: TestLoadProfile/SampleSingleMSPSolo (0.00s)

=== RUN   TestLoadProfileWithPath

=== RUN   TestLoadProfileWithPath/SampleDevModeKafka

=== RUN   TestLoadProfileWithPath/SampleDevModeSolo

=== RUN   TestLoadProfileWithPath/SampleSingleMSPChannel

=== RUN   TestLoadProfileWithPath/SampleSingleMSPKafka

=== RUN   TestLoadProfileWithPath/SampleSingleMSPSolo

--- PASS: TestLoadProfileWithPath (0.02s)

    --- PASS: TestLoadProfileWithPath/SampleDevModeKafka (0.00s)

    --- PASS: TestLoadProfileWithPath/SampleDevModeSolo (0.00s)

    --- PASS: TestLoadProfileWithPath/SampleSingleMSPChannel (0.00s)

    --- PASS: TestLoadProfileWithPath/SampleSingleMSPKafka (0.00s)

    --- PASS: TestLoadProfileWithPath/SampleSingleMSPSolo (0.00s)


Join to automatically receive all group messages.