-2

I'm trying to do a high speed memcpy in Python. I use the ctypes library which allows me to interact with C programms.

I follow this steps:

  1. I get the memory address
  2. I get the length of the data
  3. I use the ctypes' functions memmove or string_at

The results are correct but I need higher speed. Is there any faster way to do this without using C?

Thank you.

Rolaro
  • 1
  • 4
  • 1
    Show teh codez please – klutt Feb 04 '20 at 11:35
  • 2
    It seems doubtful that you can do this faster than `ctypes` can by any significant margin, if at all. Why do you need to copy memory so fast - [what problem are you actually trying to solve](http://xyproblem.info/) by doing this? – kaya3 Feb 04 '20 at 11:45
  • I found one solution in this post, in the answer of Hannah Zhang https://stackoverflow.com/questions/48808997/how-to-read-from-pointer-address-in-Python – Rolaro Feb 04 '20 at 11:56
  • 1
    If your problem is solved by an answer to another question, there is no need to post another answer linking to it; that answer exists and can be found by anyone searching for it. It also means your question is a duplicate. – kaya3 Feb 04 '20 at 12:02
  • It isn't the same question but the solution which was given in that case is good for this, so my question is not duplicated. ( Who reads both will know ...) – Rolaro Feb 04 '20 at 14:11

1 Answers1

0

I found one solution in this post:

How to read from pointer address in Python?

In the answer of Hannah Zhang.

Rolaro
  • 1
  • 4