caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Alain Frisch <alain.frisch@lexifi.com>
To: Fabrice Le Fessant <Fabrice.Le_fessant@inria.fr>
Cc: "Pierre-Marie Pédrot" <pierre-marie.pedrot@inria.fr>,
	"Ocaml Mailing List" <caml-list@inria.fr>
Subject: Re: [Caml-list] unmarshaling large data from string on 32 bits
Date: Thu, 05 Feb 2015 13:24:54 +0100	[thread overview]
Message-ID: <54D36116.70509@lexifi.com> (raw)
In-Reply-To: <CAHvkLrPyAoaSvJ+ZCu3NWwAU0DjaRnf=Ty78R0vms=T5kdaEVg@mail.gmail.com>

Hello Fabrice,

While it's certainly interesting to extend the size of strings (and it 
would solve the original problem), it would not address the problem 
related to unmarshaling large data on 32-bit systems.


Alain

On 02/05/2015 01:22 PM, Fabrice Le Fessant wrote:
> Hi,
>
>    A long time ago, we had a patch on 32 bit systems to transparently
> extend the size of strings and arrays over the 16 MB limit:
>
> http://www.ocamlpro.com/blog/2011/05/06/longval.html
>
> At the time, there was little interest in this patch. If I remember
> well, it was quite small, we could probably include it in the next
> version of OCPWin32, if you think having it under Windows would help
> you.
>
> --Fabrice
>
>
> On Thu, Feb 5, 2015 at 11:50 AM, Alain Frisch <alain.frisch@lexifi.com> wrote:
>> On 02/05/2015 10:58 AM, Pierre-Marie Pédrot wrote:
>>>
>>> On 05/02/2015 09:56, Alain Frisch wrote:
>>>>
>>>> One possible work-around is to use an alternative implementation of the
>>>> demarshaler (there is such a pure OCaml implementation in Frama-C).
>>>> Another is to avoid the generic marshaling, either by writing a manual
>>>> version for your specific data type or by generating it from your type
>>>> definitions (à la bin-prot, I assume).
>>>
>>>
>>> Both workarounds would not work. Indeed, we use closure marshalling in
>>> Coq, which is not supported by the two proposed implementations.
>>
>>
>> Waow, closure marshaling across processes: you live dangerously :-)  I hope
>> you know precisely which values go into the closures or not (exception
>> slots, global mutable data structures, etc)...
>>
>>
>>> (Plus, that would be so slow I do not even want to think about it.)
>>
>>
>> I'm not so sure.  Serialization/deserialization routines specialized for
>> specific data types avoid some runtime checks required by the generic
>> functions (for the block tags and sizes, for detecting possible sharing
>> everywhere) and can use more specialized (and thus more compact) data
>> representation.
>>
>> We have had that problem at LexiFi, where we used to rely on the generic
>> marshaling for exchanges messages between processes (hence the ticket I
>> referred to).  We finally decided to write (manually) specialized functions
>> for our type of messages (no closures, no sharing), and the performance
>> results where slower but reasonable compared to the generic marshaling
>> (without putting too much engineering effort into it).  Anyway:
>>
>>   - our previous workaround was to trigger Gc.compact explicitly for big
>> messages, which was much worse, of course;
>>
>>   - it's clear that the OCaml implementation of the generic demarshaler would
>> be slower;
>>
>>   - since this only impacts 32-bit systems, nobody seems motivated enough to
>> put energy into fixing the core issue.
>>
>>
>> Alain
>>
>>
>> --
>> Caml-list mailing list.  Subscription management and archives:
>> https://sympa.inria.fr/sympa/arc/caml-list
>> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
>> Bug reports: http://caml.inria.fr/bin/caml-bugs
>
>
>


  reply	other threads:[~2015-02-05 12:25 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-02 10:32 Enrico Tassi
2015-02-02 12:00 ` Gabriel Scherer
2015-02-02 13:08   ` Pierre-Marie Pédrot
2015-02-04 16:47   ` Enrico Tassi
2015-02-04 23:51     ` Gerd Stolpmann
2015-02-05  8:56 ` Alain Frisch
2015-02-05  9:01   ` Gabriel Scherer
2015-02-05  9:34     ` Alain Frisch
2015-02-05  9:58   ` Pierre-Marie Pédrot
2015-02-05 10:33     ` Enrico Tassi
2015-02-05 10:50     ` Alain Frisch
2015-02-05 12:22       ` Fabrice Le Fessant
2015-02-05 12:24         ` Alain Frisch [this message]
2015-02-05 12:27       ` Enrico Tassi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54D36116.70509@lexifi.com \
    --to=alain.frisch@lexifi.com \
    --cc=Fabrice.Le_fessant@inria.fr \
    --cc=caml-list@inria.fr \
    --cc=pierre-marie.pedrot@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).