... Yes, ExtLib is work in progress. If there are functions which are missing, then please suggest them or even provide patches. Rich. -- Richard Jones, CTO...
Hi, I just profiled my implicit surface polygonizer (a conversion of J Bloomenthals graphics gem IV) to see what's taking so long. compare_val is taking 357.32...
... IIRC, yes. ... Look at the second section of gprof's profile, that describes how long was spent in each call from each function. Look to see which...
... Looks like compare_val is being called most by a function camlPolygonizer__equal_113 which must be created by the compiler. Looks like that function is...
... Try this: let ( =* ) ((x, y, z) : int * int * int) (x', y', z') = x = x && y = y' && z = z' let ( <>* ) ((x, y, z) : int * int * int) (x', y', z') = x <>...
... Will do. I just tried an absurdly simple test to see how common compare_val is. For one call on a torus surface function, the following function does 5000+...
... I am glad you received examples that showed how easy this is... presumably anyone working with networking protocols designed to facilitate the transfer of...
I'll try to provide some general advice on this code. ... The types specified in the mli file do not affect the typing in the generated code, i.e. polymorphic...
Hi, I have the following code snippet: let complete_mgu mgu = let sub k v = Hashtbl.replace mgu k (substitute mgu v) ; () in Hashtbl.iter ( sub ) mgu It simple...
... IIRC triples of integers are boxed, resulting, in this case, in four times the allocation overhead compared to using an array or record. Also if you write:...
... Indeed, from what you say it looks potentially dangerous. A safe option (but somewhat costlier) would be to store in the hashtable not the values...
Have you thought about using a Map instead? What you are trying to do can be very nicely expressed using a map operation over a Map, and there can never be...
Hi Rich, ... I have opted to simply generate a new hash table when changing values whilst iterating through it. I guess this is equivalent to using Map but...
Frédéric, ... Changing the data to a reference will mean changing quite a bit of code. I will simply use the above function to generate a new hash table and...
... No. triples of integers, record and array of 3 element do have exactly the same in memory representation. What you saying is true only for float. ... ...
... It is safe in the sense that ML programs are safe (e.g. they cannot segfault) but it will probably give undefined behaviour when it replaces a value in the...
Hi Jon, ... When I meant safe it was in regards to execution behavior. ... Both options have been suggested. For now I will simply copy the hash table and...
... Sorry, my internet connection is being very unreliable... :-( ... Right, so "substitution" will not mutate the hash table, just read from it. -- Dr Jon D...
... Thanks. I partially rewrote it with type annotations almost everywhere and reduced parameter passing. compare_val still dominates but the over all run...
... If the OCaml is 2 orders of magnitude slower then something is very wrong... ... Given the results of my ray tracer, I'd expect OCaml to be almost as fast...
... What I understand is that all the following cases can happen if you add something during iter: 1) what you add will be scanned by iter because it is added...
... Yep. :) ... Yep. My thought is either it is not culling properly or the data structures aren't suitable in terms of complexity (the hash tables probably)...
While writing a simple parser I decided I would force myself to drop the ever so tempting while loop, and see if I could figure out how to write in a more...
... Is that marching cubes/tetrahedra? It would be great to publish an open-source 3D tesselator! ... Yep. I think Jacques overlooked that but it isn't too...
... The evaluation order is unspecified in many cases for efficiency. There was a thread about this very recently on caml-list. ... Yes: don't assume that...
... Yeah, that was a mistake but it actually works just as well as with k<<20, which is what I intended to code. :-) -- Dr Jon D Harrop, Flying Frog...
... That's weird - it is actually slightly slower here. That's probably because I altered the problem though... -- Dr Jon D Harrop, Flying Frog Consultancy...