Log of the #nice channel on irc.freenode.net

Using timezone: Central European Time
* cm leaves04:19
* arjanb joins05:58
* CIA-6 leaves08:17
* CIA-6 joins08:18
* CIA-6 leaves
* CIA-6 joins08:19
* CIA-6 leaves
* CIA-6 joins08:20
* CIA-6 leaves
* CIA-6 joins08:21
* CIA-6 leaves08:22
* CIA-6 joins
* CIA-6 leaves08:24
* CIA-6 joins08:25
* CIA-6 leaves
* CIA-6 joins08:26
* cm_ joins14:26
<arjanb>hi14:27
* CIA-6 leaves16:10
* CIA-6 joins16:11
<cm_>hi16:24
* cm_ leaves18:31
* CIA-6 leaves18:38
* CIA-6 joins18:39
* CIA-6 leaves18:42
* CIA-6 joins18:43
* CIA-6 leaves19:18
* CIA-6 joins19:19
* cm joins19:25
* CIA-6 leaves19:58
* CIA-6 joins19:59
* CIA-6 leaves22:19
* CIA-6 joins
<cm>arjanb: I have ambiguity problems with StringBuffer23:32
Ambiguity for symbol insert. Possibilities are :
java.lang.AbstractStringBuilder insert(java.lang.AbstractStringBuilder, nice.lang.int, nice.lang.char)
<T> java.lang.StringBuffer insert(StringBuffer, int, T)
I have some performce problems... It seems that java.lang.reflect.Array.* is the problem.23:54
61.5% 0 + 1176 java.lang.reflect.Array.get
32.0% 0 + 612 java.lang.reflect.Array.set
0.9% 0 + 18 java.lang.reflect.Array.newArray
0.8% 0 + 15 sun.reflect.Reflection.getCallerClass
0.5% 0 + 9 java.lang.Class.forName0
0.2% 0 + 4 java.lang.reflect.Array.getLength
95.9% 0 + 1834 Total stub
Function for matrix access:23:57
<T> void modify(T[][] matrix, (int,int,T) -> T func, int rowstart, int colstart) {
for (int i=rowstart; i<matrix.length; i++) {
for (int j=colstart; j<matrix[0].length; j++) {
matrix[i][j]= func(i,j,matrix[i][j]);
}
}
}
I guess that nicec doesn't compile a specialsed function with the inferred type.
As is done in c++ with templates23:58
Makeing modify() non-generic resolved the problem00:04
<arjanb>sorry was away00:23
are you using java 1.5?
<cm>Nope00:24
1.4.2
<arjanb>problem with the matrix code is explained here: http://sourceforge.net/tracker/index.php?func=detail&aid=698938&group_id=12788&atid=36278800:26
<cm>The performance penelty with the generic modify() is huge. Why not compile a specialsed version with the inferred type?00:30
That is suggested in the discussion...00:32
<arjanb>it much work to correctly
you could try to change the signature to modify(List<List<T>> matrix, 00:33
<cm>But wouldn't that result in boxed types?00:34
Is there any problem with compiling modify as modify_<mangle>_int, modify_<mangle>_double etc00:35
<arjanb>it think it's faster at the moment
<cm>Strange that the List version is faster00:36
<arjanb>reflect.Array is very slow and should not be generated by the compiler in the future but i haven't managed to fix that yet00:39
for StringBuffer are some retypings wrong00:40
but i find it strange that this ambiguity problem didn't arise earlier00:42
<cm>Ok, maybe a static ambiguity proof system?00:43
Such that the methods defined in java.* isn't subjected to ambiguity. 00:44
But probably not worth the effort
<arjanb>indeed00:45
i guess AbstractStringBuilder is a new class in 1.4.2
<cm>Aha, similar problem occur with inheritance when new methods are introduced00:47
<arjanb>no problem with java 1.4.1 here
do you build nicec from cvs?00:49
<cm>Yes, it worked with the sf.net/nice.jar
<arjanb>removing line 61 to 64 from nice/stdlib/nice/lang/java.nice should fix the ambiguity problem00:51
<cm>Thanks
<arjanb>do you have timings for modify with a list signature?00:52
<cm>I didn't test that. I made modify non-generic
Performance is critical for this application00:53
<arjanb>then is that the best work around
<cm>Do you know if the jvm-jit is capable of inlining lambda expressions? 00:55
A guess you compile lambda expressions to methods00:56
<arjanb>it's doing a good job but it might still 2 times slower because the argument are primitives thus boxed00:57
<cm>Why are they boxed? Easier to compile?00:59
<arjanb>yes because otherwise you need an abstract class for each method type with primitive arguments01:01
a little performance tip when working with nested arrays in java:01:03
for (int i=rowstart; i<matrix.length; i++) {
let row = matrix[i];
<cm>Thanks, about the let construct. You can't update the reference but you can still modify the referred object. What is the generall idea?01:09
<arjanb>there is not a more general idea than that afaik01:11
<cm>Got to go. Thanks for your help! 01:14
<arjanb>does removing the lines in java.nice work for you?01:15
<cm>I don't have the cvs version at home. I will try that tomorrow. 01:16
<arjanb>i guess it will work and commit to cvs01:17
good night
<cm>good night
* cm leaves
<CIA-6>03arjanb * 10Nice/stdlib/nice/lang/java.nice: Removed some retypings on StringBuffer because of ambigiuty when using java 1.4.2 or newer.01:44
* arjanb leaves02:16
* CIA-6 leaves02:25
* CIA-6 joins02:26

Generated by Sualtam