Skip to content

fast paths for ccsid 1208 - #334

Open
mdg1349 wants to merge 1 commit into
IBM:mainfrom
mdg1349:fast_path_ccsid_1208
Open

fast paths for ccsid 1208#334
mdg1349 wants to merge 1 commit into
IBM:mainfrom
mdg1349:fast_path_ccsid_1208

Conversation

@mdg1349

@mdg1349 mdg1349 commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

In this PR, i made some changes regarding the conversion table for CCSID 1208 to use normal JVM string functions for speed and simplicity. The new code paths are only activated if fault tolerant conversions are disabled (which is the default).

BOB gave me a hand in investigating the issue, so I'll report some of its musings:

Code Organization

  • Original custom logic extracted into private faultTolerant*() methods
  • Added Override annotations for clarity
  • Maintained all existing fault-tolerant behavior unchanged

Benefits

  1. Performance: JVM's UTF-8 implementation is highly optimized with:
  • Native code execution
  • SIMD instructions where available
  • Years of optimization and tuning
  1. Maintainability:
  • Less custom code to maintain for the common case
  • Delegates to well-tested JVM implementation
  • Reduces potential for bugs in UTF-8 handling
  1. Correctness:
  • Leverages battle-tested JVM UTF-8 codec
  • Reduces risk of edge case bugs in custom implementation
  1. Backward Compatibility:
  • Fault-tolerant mode still uses original custom logic
  • No behavior changes for existing fault-tolerant users
  • Default behavior improved without breaking changes

Why This Matters
CCSID 1208 is UTF-8, one of the most common character encodings. Most applications don't need fault-tolerant conversion, so this optimization benefits the majority of use cases while preserving special handling for those who need it.

Signed-off-by: Matteo Di Liberto Gasparin <matteo.diliberto@sanmarcoinformatica.it>
Signed-off-by: mdg1349 <142481417+mdg1349@users.noreply.github.com>
@mdg1349
mdg1349 force-pushed the fast_path_ccsid_1208 branch from fe67852 to 1c0e576 Compare July 27, 2026 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant