Tink is a multi-language, cross-platform, open source library that provides cryptographic APIs that are secure, easy to use correctly, and hard(er) to misuse.
It seems that java tink library does not scale with java threads. Find attached a small java test program.
Find below test results with one and three threads, running on a unix (redhat) box with 24 vCPUs.
In both cases around 1.000.000 encryption operations are executed every second. The amount of encryption operations is not increasing when using more threads.
java AeadThread encrypt "This is a test" 10000000 1
origtext: This is a test
Thread: 1 for encryption loop: Mon Jun 12 10:49:25 CEST 2023
Thread: 1 after encryption loop: Mon Jun 12 10:49:34 CEST 2023
java AeadThread encrypt "This is a test" 10000000 3
origtext: This is a test
Thread: 2 for encryption loop: Mon Jun 12 11:09:25 CEST 2023
Thread: 3 for encryption loop: Mon Jun 12 11:09:25 CEST 2023
Thread: 1 for encryption loop: Mon Jun 12 11:09:25 CEST 2023
Thread: 1 after encryption loop: Mon Jun 12 11:09:53 CEST 2023
Thread: 2 after encryption loop: Mon Jun 12 11:09:53 CEST 2023
Thread: 3 after encryption loop: Mon Jun 12 11:09:53 CEST 2023
test environment:
java version: openjdk version "1.8.0_362"
java tink library version: 1.9.0
It seems that java tink library does not scale with java threads. Find attached a small java test program.
Find below test results with one and three threads, running on a unix (redhat) box with 24 vCPUs.
In both cases around 1.000.000 encryption operations are executed every second. The amount of encryption operations is not increasing when using more threads.
java AeadThread encrypt "This is a test" 10000000 1 origtext: This is a test Thread: 1 for encryption loop: Mon Jun 12 10:49:25 CEST 2023 Thread: 1 after encryption loop: Mon Jun 12 10:49:34 CEST 2023
java AeadThread encrypt "This is a test" 10000000 3 origtext: This is a test Thread: 2 for encryption loop: Mon Jun 12 11:09:25 CEST 2023 Thread: 3 for encryption loop: Mon Jun 12 11:09:25 CEST 2023 Thread: 1 for encryption loop: Mon Jun 12 11:09:25 CEST 2023 Thread: 1 after encryption loop: Mon Jun 12 11:09:53 CEST 2023 Thread: 2 after encryption loop: Mon Jun 12 11:09:53 CEST 2023 Thread: 3 after encryption loop: Mon Jun 12 11:09:53 CEST 2023
test environment: java version: openjdk version "1.8.0_362" java tink library version: 1.9.0
Aead object is shared between threads.
AeadThread.zip