This PR contains a workaround for the problem of creating a tuple of array dimensions in when r2j is called for the vector and matrix cases. There are a few smaller optimizations that use memcpy to copy the vector from R to julia or hoist the R data pointer lookup macro. When copying a STRSXP, I use a branch with alternate loops for ASCII or Utf8 rather than branching in the loop.
The end result is a 19X speedup for j2r. If this new arrangement looks good, I can do the same thing for R_Julia_MD_NA and then simplify RDims_JuliaTuple to remove the vector case.
I tried to figure out how to use jl_apply_tuple_type in RDims_JuliaTuple, but failed. I'm sure it can be done, though.
This PR contains a workaround for the problem of creating a tuple of array dimensions in when r2j is called for the vector and matrix cases. There are a few smaller optimizations that use memcpy to copy the vector from R to julia or hoist the R data pointer lookup macro. When copying a STRSXP, I use a branch with alternate loops for ASCII or Utf8 rather than branching in the loop.
The end result is a 19X speedup for j2r. If this new arrangement looks good, I can do the same thing for R_Julia_MD_NA and then simplify RDims_JuliaTuple to remove the vector case.
I tried to figure out how to use jl_apply_tuple_type in RDims_JuliaTuple, but failed. I'm sure it can be done, though.