caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Gerd Stolpmann <info@gerd-stolpmann.de>
To: Yotam Barnoy <yotambarnoy@gmail.com>
Cc: Ocaml Mailing List <caml-list@inria.fr>
Subject: Re: [Caml-list] Expanding the Float Array tag
Date: Tue, 17 Sep 2013 11:32:40 +0200	[thread overview]
Message-ID: <1379410360.10274.156.camel@zotac> (raw)
In-Reply-To: <CAN6ygOnK+xut5W0poyzrZcC770kwZ4VgKY1du=bUsPhOeCP7sg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1817 bytes --]

Am Montag, den 16.09.2013, 11:26 -0400 schrieb Yotam Barnoy:
> Having looked through some of the ocaml runtime's code, I have a
> question regarding the Double_array block tag. Why not use a single
> tag for all block content that doesn't contain pointers instead? This
> would allow optimization of all cases where no pointers are involved,
> including float tuples, records with ints, bools and floats etc. 
> 
> The only use-case I've seen so far for Double_array tags is for
> polymorphic comparison ie. we need the type information to parse
> doubles correctly. However, the only default comparison that's valid
> on an array of anything is an equality comparison, which is easily
> doable without type information. Therefore, I'm confused as to why
> this is necessary.

You also need the Double_array tags for normal array accesses on 32 bit
platforms: If you call a polymorphic function taking an array argument,
the function doesn't know whether it is called with a float array or a
normal array. Because of this, the compiler generates a dynamic check
whether the array is float or something else. For float, every element
is 64 bits wide, but for anything else it is 32 bits only.

You are right that a special "no-scan" tag would speed up the GC marking
phase when there are large arrays profiting from it - for all other
no-scan cases except float.

Gerd
> 
> Thanks in advance for any answers
> 
> Yotam Barnoy
> 

-- 
------------------------------------------------------------
Gerd Stolpmann, Darmstadt, Germany    gerd@gerd-stolpmann.de
My OCaml site:          http://www.camlcity.org
Contact details:        http://www.camlcity.org/contact.html
Company homepage:       http://www.gerd-stolpmann.de
------------------------------------------------------------

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

  parent reply	other threads:[~2013-09-17  9:32 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-16 15:26 Yotam Barnoy
2013-09-16 16:29 ` Markus Mottl
2013-09-16 16:49   ` Yotam Barnoy
2013-09-16 17:14     ` Markus Mottl
2013-09-16 19:09       ` Yotam Barnoy
2013-09-17  0:31         ` Yotam Barnoy
2013-09-19  9:40     ` Goswin von Brederlow
2013-09-17  9:32 ` Gerd Stolpmann [this message]
2013-09-18 15:10   ` Yotam Barnoy
2013-09-19  6:18     ` oleg
2013-09-19  9:47       ` Goswin von Brederlow
2013-09-19 10:10     ` Goswin von Brederlow
2013-09-20  2:18       ` Yotam Barnoy
2013-09-20  6:25         ` Goswin von Brederlow

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=1379410360.10274.156.camel@zotac \
    --to=info@gerd-stolpmann.de \
    --cc=caml-list@inria.fr \
    --cc=yotambarnoy@gmail.com \
    /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).