Hello,
I wanted to ask what kind of indirection for functions do you provide or plan
to provide in chapel?
to provide in chapel?
Does chapel have function/procedure pointers? I couldn't find nothing about this
in the documentation 0.95. Or do you rely solely on classes for this? Will be the
select statement optimized or will it be just a sequence of if-statements?
My question goes in a similar direction as this question about Go:
http://stackoverflow.com/questions/9928221/table-of-functions-vs-switch-in-golang
Here is what Ken Thompson has to say about optimizing switches:
https://groups.google.com/forum/#!msg/golang-nuts/IURR4Z2SY7M/R7ORD_yDix4J
My question is not only about execution speed but also about memory consumption.
I remember that in Java the following code consumed MORE memory:
class Main {
private class Tuple { int x, y; }
private Tuple[] data = "" Tuple[100];
public Main() {
for (int i=0; i<data.length; i++)
data[i] = new Tuple();
}
}
then this code:
class Main {
private int[] x = new int[100];
private int[] y = new int[100];
}
Wouldn't an array of function pointers consume less memory then the array
of references to classes, which have the only purpose of indirection?
Thank you.
------------------------------------------------------------------------------ Slashdot TV. Video for Nerds. Stuff that matters. http://tv.slashdot.org/
_______________________________________________ Chapel-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/chapel-users
