Re: Help me understand what part of this code is slow, and how to make it faster?

2016-11-21 Thread Michał Marczyk
PS. Results for the original input on my box. Going by the the timings posted above, yours is rather beefier, so this is probably faster than the current F# version. (c/quick-bench (nth-shell 2000 (point. 0 0))) Evaluation count : 6 in 6 samples of 1 calls. Execution time mean : 2.956

Re: Help me understand what part of this code is slow, and how to make it faster?

2016-11-21 Thread Michał Marczyk
Some further optimizations for a factor of ~2.3 speed-up over nth5 as copy & pasted from upthread (6.713742 ms → 2.897630 ms) in (c/quick-bench (nth-shell 100 (point. 0 0))) (1) java.util.HashSet has a ctor that takes initial capacity of the set as an int. Passing in (* 4 (.size s1)) when const

Re: Help me understand what part of this code is slow, and how to make it faster?

2016-11-21 Thread Didier
I tried it with the safe equals, and it is slightly slower, but still faster then all others at 4.5ms. The non safe equals gives me 4s. Though this is now within my error margin. If ire-run quick-bench, I sometime get a mean equal for each, so I don't think the instance check adds that much ove

Re: Help me understand what part of this code is slow, and how to make it faster?

2016-11-21 Thread Steve Miner
> On Nov 21, 2016, at 3:05 PM, Didier wrote: > > I experimented with this a lot, and took everyone's advice, and this is the > fastest I got, even faster then Michael Gardner's answer. > > (deftype point5 [^long i ^long j] > Object > (equals [this that] (and (= (.i this) (.i ^point5 that))

Socket server and PuTTY

2016-11-21 Thread 'Thomas Meyer' via Clojure
Hi, When I connect to the socket server with PuTTY, what are the correct connection parameters? Telnet mode gives strange error messages, raw mode seems to work but when doing (find-doc "string") the output has strange blanks and carriage returns. Help is appreciated. With kind regards Thomas

[ANN] maxiphobe 0.0.1 – Persistent Meldable Priority Queues

2016-11-21 Thread Michał Marczyk
Hi, I am pleased to announce the initial release of maxiphobe, a meldable priority queue library based on Okasaki's maxiphobic heaps (see Okasaki, "Alternatives to Two Classic Data Structures"). Maxiphobic heaps are a strikingly simple purely functional approach to implementing priority queues tha

Re: Help me understand what part of this code is slow, and how to make it faster?

2016-11-21 Thread Andy Fingerhut
Not sure which version of Clojure you are using, but in all versions up to the latest 'official' release, Clojure 1.8.0, records have their hash value calculated every time they are needed, with no caching of the calculated value. The hash value is needed every time an operation is done in a Cloju

Re: Help me understand what part of this code is slow, and how to make it faster?

2016-11-21 Thread Didier
I experimented with this a lot, and took everyone's advice, and this is the fastest I got, even faster then Michael Gardner's answer. (deftype point5 [^long i ^long j] Object (equals [this that] (and (= (.i this) (.i ^point5 that)) (= (.j this) (.j ^point5 that

Re: Trouble Running Chime Application outside for repl

2016-11-21 Thread Chris Snyder
That Solved it. Thanks for your help. added `@(promise)` and works like a charm On Monday, November 21, 2016 at 10:14:06 AM UTC-5, James Henderson wrote: > > Hi Chris, > > Thanks for posting an example - unfortunately I can't get onto it at the > moment because it seems gitlab is down :( > > FW

Re: Trouble Running Chime Application outside for repl

2016-11-21 Thread James Henderson
Hi Chris, Thanks for posting an example - unfortunately I can't get onto it at the moment because it seems gitlab is down :( FWIW, I've seen a similar issue before where the schedule will run for a minute or so, then the process will exit successfully (even though you'd like it to continue) -

Trouble Running Chime Application outside for repl

2016-11-21 Thread Chris Snyder
Have a program I want to run every 5 seconds unless the previous run is not finished then I want it to wait on the previous run to finish. To do this I used a library called Chime (https://github.com/jarohen/chime). *The Problem* is the program works perfectly in repl but will not work outsid