New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Array.copy can be faster #2395
Comments
Comment author: administrator Dear George,
There's only one case where I'm sure "modify" isn't needed: when Did you had other cases in mind? Best wishes,
|
Comment author: administrator On Apr 1, 2004, at 17:28, xavier.leroy@inria.fr wrote:
I think the only interesting cases are: (1) when the new array is in the young generation (regardless of The exact condition (2) subsumes (2a) and (2b): when you are sure I think modify is already short-circuited in case (2b). If we move Array.copy to the C code, we can handle case (1) On the other hand, C code is obviously more expensive to write, -- Damien |
Comment author: administrator Hi, Perhaps I do not understand the GC that ocaml uses. But when you do an I looked now at make_vect and I see that it is more complicated than I George.
|
Comment author: administrator From: necula@eecs.berkeley.edu
Well, only if its size is smaller than Max_young_wosize, which seems
The case < Max_young_wosize is actually pretty simple:
So I suppose you're right this could be optimized. By the way, the following cases in make_vect look like a clever Jacques
I'm no GC expert either, but my belief was that only the destination |
Comment author: @xavierleroy Faster implementations of "Array.blit", "Array.copy", "Array.sub", "Array.append" and "Array.concat" now integrated in SVN trunk (commit 11913). |
Original bug ID: 2395
Reporter: administrator
Status: closed (set by @xavierleroy on 2011-12-21T10:39:17Z)
Resolution: fixed
Priority: normal
Severity: feature
Fixed in version: 3.13.0+dev
Category: ~DO NOT USE (was: OCaml general)
Related to: #4591
Bug description
Full_Name: George Necula
Version: 3.07
OS: cygwin
Submission from: raw.cs.berkeley.edu (128.32.153.230)
While doing some profiling I noticed that Array.copy internally uses the
"modify" function. I do not fully understand the internals of the run-time
system, but I think that it is not necessary to use "modify" in this case.
However, I think that the only way to achieve this is to write Array.copy in C.
George.
The text was updated successfully, but these errors were encountered: