You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 596 Reporter: administrator Status: closed Resolution: fixed Priority: normal Severity: minor Category: ~DO NOT USE (was: OCaml general)
Bug description
behaviour of output_value
Full_Name: Hugo Herbelin
Version: 3.02
OS: Linux
Submission from: oto.inria.fr (192.93.2.2)
Dear implementors,
Using the Coq proof assistant, we observed a noticeably erratic
behaviour of output_value on values of compacted size > 100 KB.
On the examples we studied, the time needed for marshalling varies
from 16 KB/s to more than 1 MB/s for values with a priori no regular
structure (measure done on a G3 500 Mhz).
I was able to reproduce such a bad behaviour of output_value on the
following small example. Actually, from roughly n=880000, there is a
boom in the time needed by to_channel.
let n = int_of_string (Sys.argv.(1));;
let v = Array.create n None;;
for i=0 to n-1 do v.(i) <- Some i done;;
let ch = open_out_bin "toto";;
Marshal.to_channel ch v [];;
close_out ch;;
I looked at extern.c and applied a quick hack, resizing the hash
table as soon as a third is occupied instead of an half. This clearly
improves the performance on the above toy example (27 times faster for
n=900000) but I'm not sure this is the good answer to the
problem. Especially, on our real examples (the files of the Coq FTA
user contribution -- see coq.inria.fr), the worst case remains as low
as 25 KB/s (precisely 40s to output a 1 MB file, to be compared with
the 1.2 MB/s (i.e. 0.5s) obtained to output another 650 KB file).
Thanks in advance for your help.
Hugo
The text was updated successfully, but these errors were encountered:
Fixed 2001-10-26 by XL: use multiplicative hashing instead of modulo hashing,
seems to perform better when there are many adjacent blocks in the argument to
output_value.
Original bug ID: 596
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)
Bug description
behaviour of output_value
Full_Name: Hugo Herbelin
Version: 3.02
OS: Linux
Submission from: oto.inria.fr (192.93.2.2)
Dear implementors,
Using the Coq proof assistant, we observed a noticeably erratic
behaviour of output_value on values of compacted size > 100 KB.
On the examples we studied, the time needed for marshalling varies
from 16 KB/s to more than 1 MB/s for values with a priori no regular
structure (measure done on a G3 500 Mhz).
I was able to reproduce such a bad behaviour of output_value on the
following small example. Actually, from roughly n=880000, there is a
boom in the time needed by to_channel.
let n = int_of_string (Sys.argv.(1));;
let v = Array.create n None;;
for i=0 to n-1 do v.(i) <- Some i done;;
let ch = open_out_bin "toto";;
Marshal.to_channel ch v [];;
close_out ch;;
I looked at extern.c and applied a quick hack, resizing the hash
table as soon as a third is occupied instead of an half. This clearly
improves the performance on the above toy example (27 times faster for
n=900000) but I'm not sure this is the good answer to the
problem. Especially, on our real examples (the files of the Coq FTA
user contribution -- see coq.inria.fr), the worst case remains as low
as 25 KB/s (precisely 40s to output a 1 MB file, to be compared with
the 1.2 MB/s (i.e. 0.5s) obtained to output another 650 KB file).
Thanks in advance for your help.
Hugo
The text was updated successfully, but these errors were encountered: