You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "bpereto (via GitHub)" <gi...@apache.org> on 2023/05/29 11:40:08 UTC

[GitHub] [pulsar-client-go] bpereto opened a new pull request, #1022: [Issue 1021][client] FIX: use maphash instead of crypto/sha256 for hash function of hashmap in Schema.hash()

bpereto opened a new pull request, #1022:
URL: https://github.com/apache/pulsar-client-go/pull/1022

   use golang/hash/maphash instead of crypto/sha256 for hash function of hashmap in Schema.hash()
   as the hash function is used for determining the hash key, it is safe to use a non-cryptographic function.
   
   Fixes #1021
   
   ### Motivation
   
   Improve performance of the SchemaCache by replacing the cryptographic hash function.
   
   ### Modifications
   
   Replaced the crypto/sha256 with golang/hash/maphash function.
   
   ### Verifying this change
   
   - [ ] Make sure that the change passes the CI checks.
   
   This change is a trivial rework / code cleanup without any test coverage.
   
   ### Does this pull request potentially affect one of the following parts:
   
   *If `yes` was chosen, please highlight the changes*
   
     - Dependencies (does it add or upgrade a dependency): no
     - The public API: no
     - The schema: no
     - The default values of configurations: no
     - The wire protocol: no
   
   ### Documentation
   
     - Does this pull request introduce a new feature? no
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar-client-go] tisonkun merged pull request #1022: [Issue 1021][client] FIX: use maphash instead of crypto/sha256 for hash function of hashmap in Schema.hash()

Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun merged PR #1022:
URL: https://github.com/apache/pulsar-client-go/pull/1022


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar-client-go] tisonkun commented on pull request #1022: [Issue 1021][client] FIX: use maphash instead of crypto/sha256 for hash function of hashmap in Schema.hash()

Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on PR #1022:
URL: https://github.com/apache/pulsar-client-go/pull/1022#issuecomment-1569596184

   Merging...


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar-client-go] bpereto commented on pull request #1022: [Issue 1021][client] FIX: use maphash instead of crypto/sha256 for hash function of hashmap in Schema.hash()

Posted by "bpereto (via GitHub)" <gi...@apache.org>.
bpereto commented on PR #1022:
URL: https://github.com/apache/pulsar-client-go/pull/1022#issuecomment-1567496951

   Added a static seed with `MakeSeed`. 
   tested it with my application, works as intended for me.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar-client-go] bpereto commented on pull request #1022: [Issue 1021][client] FIX: use maphash instead of crypto/sha256 for hash function of hashmap in Schema.hash()

Posted by "bpereto (via GitHub)" <gi...@apache.org>.
bpereto commented on PR #1022:
URL: https://github.com/apache/pulsar-client-go/pull/1022#issuecomment-1569541434

   > Thank you!
   > 
   > To double-check the patch - it changes local access to the schema map, without any changes to the actual schema go through the wire, right?
   
   yes, no changes to the schema itself, just the hash method to get a key for the local hashmap struct to update or access the cached schema.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar-client-go] tisonkun commented on pull request #1022: [Issue 1021][client] FIX: use maphash instead of crypto/sha256 for hash function of hashmap in Schema.hash()

Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on PR #1022:
URL: https://github.com/apache/pulsar-client-go/pull/1022#issuecomment-1569596498

   Thank you!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar-client-go] bpereto commented on pull request #1022: [Issue 1021][client] FIX: use maphash instead of crypto/sha256 for hash function of hashmap in Schema.hash()

Posted by "bpereto (via GitHub)" <gi...@apache.org>.
bpereto commented on PR #1022:
URL: https://github.com/apache/pulsar-client-go/pull/1022#issuecomment-1567459799

   I saw the seed is random. so theres a method needed to fix the seed.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org