Working with binary data in ABAP

824 views Asked by At

I'm trying to implement some cryptographic functions in ABAP, and I'm confused with low performance of operations on binary strings.

For example, I have a string of X (not XString) and I want to read it byte after byte in a loop. I say:

DO n TIMES.
  b = data+offset(1).
...

This works, but read speed is around 1.5 MB/s. Another operations including bitwise addition, circular shifts and modular additions are working slow as well.

As the result, I've got around 600 KB/s hashing speed in ABAP compared to ~100 MB/s in C/C++.

I've got a doubt that ABAP is suitable for processing binary data. Maybe there are another idiomatic ways to handle binary data; or there's no way but extracting cryptographic functions into, let's say, C# or Java services?

1

There are 1 answers

0
mjturner On BEST ANSWER

As has been suggested, ABAP is not necessarily the best way to implement system-type functionality, not only for performance reasons but because handling certain data types in ABAP can be quite unwieldy at times.

Perhaps you can implement your crypto functions in C and then interface to them from ABAP via RFC, with your C application acting as an RFC server and you calling it from ABAP via an RFC call. You can find out more about installing the NetWeaver RFC SDK here and about writing an RFC server here.