Skip to content
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

Erratic #3003

Closed
vicuna opened this issue Oct 24, 2001 · 1 comment
Closed

Erratic #3003

vicuna opened this issue Oct 24, 2001 · 1 comment
Labels

Comments

@vicuna
Copy link

vicuna commented Oct 24, 2001

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

@vicuna
Copy link
Author

vicuna commented Oct 30, 2001

Comment author: administrator

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.

@vicuna vicuna closed this as completed Oct 30, 2001
@vicuna vicuna added the bug label Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant