David,
Would you know the difference between mem-o and member-o in Jim's
implementation...?
Thanks,
Sunil.
On Sat, Nov 6, 2010 at 7:36 AM, Sunil S Nandihalli <
sunil.nandiha...@gmail.com> wrote:
> Hi David,
> I get (20) whether "(& x 10)" is commented out or not.. I was expecting it
> to return
after looking through his source code ... I discovered that replacing cond-u
with cond-a gives me the expected output .. but I am unable to explain what
I have found...
Regards,
Sunil.
On Fri, Nov 5, 2010 at 7:16 PM, David Nolen wrote:
> On Thu, Nov 4, 2010 at 11:36 PM, Sunil S Nandihalli <
> su
Awesome. You managed to reproduce my initial solution, but working
with arrays all the way. It is already quite a bit faster than what I
have, but still nowhere near Python.
I'll put it on the list for things to look at.
On Nov 6, 1:27 am, Benny Tsai wrote:
> Oops, sorry, got my terminology wron
> You can use Visual VM (https://visualvm.dev.java.net/) to see how the
> VM is using memory. I don't think it specifically show a log of GC
> activity, but it is pretty clear from the graphs.
Or just use -XX:+PrintGC and maybe -XX:+PrintGCDetails and
-XX:+PrintGCTimeStamps.
I haven't checked wh
You'll learn Python quickly enough anyhow. Python is not very hard.
2010/11/5 Sean Corfield
> On Fri, Nov 5, 2010 at 2:33 PM, Mike Meyer
> wrote:
> > This affect only works if the languages are sufficiently different to
> > have different "obvious" solutions for a large number of problems.
> >
[GC 524288K->103751K(2009792K), 0.1105872 secs]
[GC 628039K->105751K(2009792K), 0.0925628 secs]
[GC 630039K->109023K(2009792K), 0.0702017 secs]
[GC 633311K->115263K(2009792K), 0.0766341 secs]
[GC 639551K->117723K(2009792K), 0.0731049 secs]
[GC 642011K->120195K(1980096K), 0.0755788 secs]
[GC 614787K
This is fixed now.
Stu
> Just FYI, using clojure 1.3.0-master-SNAPSHOT and contrib/standalone
> 1.3.0-SNAPSHOT, I get the following error when I (:use
> [clojure.contrib.sql]):
>
> Exception in thread "main" java.lang.RuntimeException:
> java.lang.NoSuchMethodError:
> clojure.lang.Symbol.create(
On 2010-11-06, at 9:08 AM, pepijn (aka fliebel) wrote:
> I increased the heap space a lot, but I'm just bordering on the edge
> of my real memory, so it's not helping much.
Did you try pushing the minimum heap space up. I'm usually lazy and set them to
the same. I've had serious trouble caused
> For 30 second worth of calculations, this doesn't look to bad to me.
If that was for all of the 30 seconds then yeah, GC is not the issue.
--
/ Peter Schuller
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to cl
>> I increased the heap space a lot, but I'm just bordering on the edge
>> of my real memory, so it's not helping much.
>
> Did you try pushing the minimum heap space up. I'm usually lazy and set them
> to the same. I've had serious trouble caused by the way the JVM increases the
> heap space. Se
On 2010-11-06, at 10:22 AM, Peter Schuller wrote:
>>> I increased the heap space a lot, but I'm just bordering on the edge
>>> of my real memory, so it's not helping much.
>>
>> Did you try pushing the minimum heap space up. I'm usually lazy and set them
>> to the same. I've had serious trouble
On Sat, Nov 6, 2010 at 5:59 AM, iko...@gmail.com wrote:
> You'll learn Python quickly enough anyhow. Python is not very hard.
I generally pick up new programming languages pretty quickly. I
started my (working) life as a compiler writer and spent three years
prior doing research into functional l
Thanx!
Confirmed that my code now runs perfectly on 1.3.0 (master) SNAPSHOT.
On Sat, Nov 6, 2010 at 6:33 AM, Stuart Halloway
wrote:
> This is fixed now.
>
> Stu
>
>> Just FYI, using clojure 1.3.0-master-SNAPSHOT and contrib/standalone
>> 1.3.0-SNAPSHOT, I get the following error when I (:use
>>
On Sat, Nov 6, 2010 at 5:02 AM, Sunil S Nandihalli <
sunil.nandiha...@gmail.com> wrote:
> after looking through his source code ... I discovered that replacing
> cond-u with cond-a gives me the expected output .. but I am unable to
> explain what I have found...
> Regards,
> Sunil.
>
mem-o is the
David,
That's exactly right. (Pending a review of "The Reasoned Schemer" when
I get home)
Jim
On Nov 6, 11:18 am, David Nolen wrote:
> On Sat, Nov 6, 2010 at 5:02 AM, Sunil S Nandihalli <
>
> sunil.nandiha...@gmail.com> wrote:
> > after looking through his source code ... I discovered that repl
On Sat, Nov 6, 2010 at 1:53 AM, Stuart Halloway
wrote:
> Clojure 1.3 Alpha 2 is now available at
Hi,
^^^ note the version, but the subject
says it all, so...
I downloaded the alpha3 release and have run it with the recent build
of clojure-contrib #253 [1]. When I u
Hi all,
be gentle please: I have only just started using clojure.
I run the following on an Intel Core 2 Duo CPU (starting clojure with
"java -Xms1000m -Xmx1000m -jar clojure.jar"):
user=> (time (nth (doall (map inc (range 1000))) 999))
"Elapsed time: 5944.068355 msecs"
1000
user=>
Hey,
I read http://www.cs.hmc.edu/~oneill/papers/Sieve-JFP.pdf a while ago
and noticed you had referenced the paper and implemented the naive
algorithm in contrib and thought I could chip in and do the sieve for
you but get an error in my current implementation with only a million
primes.
"Excepti
On Sat, Nov 6, 2010 at 11:28 AM, thattommyhall wrote:
> Hey,
>
> I read http://www.cs.hmc.edu/~oneill/papers/Sieve-JFP.pdf a while ago
> and noticed you had referenced the paper and implemented the naive
> algorithm in contrib and thought I could chip in and do the sieve for
> you but get an error
While grocery shopping this morning, it occurred to me that it would
be even faster to do a single pass over the blocks array, and update
the count in one of 128 maps depending on the current index. Of
course, when I got home and took another look at your gist page, it
turns out that's you've alre
The amount of work in each element of the pmap is so small that the overhead
per element is dominating the CPU usage, e.g. overhead like constructing a
future for each element of the collection you are mapping over. Try a test
case where the computation being done in the function you supply to
thanks
On Nov 6, 6:04 pm, Andy Fingerhut wrote:
> The amount of work in each element of the pmap is so small that the overhead
> per element is dominating the CPU usage, e.g. overhead like constructing a
> future for each element of the collection you are mapping over. Try a test
> case where
using more then one thread is no silver bullet.
What would you do if you have to count to 1.
Would you just start counting or would go and hire 2 more people
explain them what to do and then count together?
In this case you would just start counting because you know that you
will be faster b
Has anyone successfully used Clojure 1.3 from the bootclasspath?
I ran into issues with Clojure 1.2 where you couldn't transitively
require from namespaces on the bootclasspath. So if you loaded
clojure.test, it wouldn't work unless you required clojure.template,
clojure.stacktrace, and the other
On Sat, Nov 6, 2010 at 2:00 PM, Phil Hagelberg wrote:
> Has anyone successfully used Clojure 1.3 from the bootclasspath?
Before anyone asks why I'm suggesting going to such lengths to work
with the bootclasspath, I should note that on my machine it cuts
Clojure's boot time in half. (1.243s -> 0.5
On Nov 6, 7:57 pm, Ken Wesson wrote:
> Here's a Clojure sieve that works fine up to at least 50
> million and is reasonably fast (though the same algorithm implemented
> in Java is 10x faster even with the type hints and primitive
> arithmetic in the Clojure; not sure why).
>
> (defn primes-to [n]
On Sat, Nov 6, 2010 at 5:50 PM, Juha Arpiainen wrote:
> On Nov 6, 7:57 pm, Ken Wesson wrote:
>> (filter identity (map #(if %1 %2) (drop 2 sieve) (iterate inc 2)))
>
> Returning a lazy seq doesn't seem to make much sense here,
> especially since (map ... (drop 2 sieve)) holds onto the
>
On Fri, 05 Nov 2010 19:03:20 -0700, Yang Dong wrote:
> Maybe because Clojure has a vector, and conj conjoins new elements to
> the end of the vector, so there's mere little use of fold-right. But,
> fold-right is an abstraction tool, missing it in the core is kind of
> pity.
fold-right and reduce
Am 06.11.2010 12:57, schrieb philip schwarz:
Hi all,
be gentle please: I have only just started using clojure.
I run the following on an Intel Core 2 Duo CPU (starting clojure with
"java -Xms1000m -Xmx1000m -jar clojure.jar"):
user=> (time (nth (doall (map inc (range 1000))) 999))
"El
On Sat, Nov 6, 2010 at 11:25 PM, André Thieme
wrote:
> Am 06.11.2010 12:57, schrieb philip schwarz:
>>
>> Hi all,
>>
>> be gentle please: I have only just started using clojure.
>>
>> I run the following on an Intel Core 2 Duo CPU (starting clojure with
>> "java -Xms1000m -Xmx1000m -jar clojure.ja
Am 07.11.2010 04:29, schrieb Ken Wesson:
On Sat, Nov 6, 2010 at 11:25 PM, André Thieme
Try
(time (count (map (fn [_] (Thread/sleep 1)) (range 1000
vs.
(time (count (pmap (fn [_] (Thread/sleep 1)) (range 1000
On my system this is 1002 msecs vs. 39 msecs.
Your system has TWENTY-FIVE COR
I like tinkering with prime sieve algorithms.
Here's the fastest one I've come up with:
(defn bit-sieve [n]
(let [n (int n)]
"Returns a vector of all primes from 2 to n (not including n)"
(let [root (int (Math/round (Math/floor (Math/sqrt n]
(loop [i (int 3)
a (ja
Clojure's reduce is fold-left, not fold-right. My suspicion is that
fold-right is not as amenable to laziness or to tail-call recursion as
fold-right, but I don't have much experience in the area so I could be
wrong.
What I'm surprised we're missing is unfold, not foldr: unfold is easy
to define l
33 matches
Mail list logo