Performance

49 views
Skip to first unread message

Ismail s

unread,
Jul 28, 2016, 9:09:54 AM7/28/16
to Brick Users
Hi,

First off, thanks for making this library. It's much better than just using ncurses directly.

I have been working on a matrix simulation (you know, the movie...) using this library. Atm, it renders on screen and animates correctly, but uses quite a bit of cpu when the frequency of renderings is several times a second. My question is, are you planning on improving the performance any time soon? I would like to help, but:

1. Would have to set aside time
2. I am still learning haskell (it was hard enough just getting some sort of profiling to work), so am not massively skilled

Thanks,
Ismail S

Jonathan Daugherty

unread,
Jul 29, 2016, 1:53:54 AM7/29/16
to Ismail s, Brick Users
Hi,

> First off, thanks for making this library. It's much better than just
> using ncurses directly.

You're welcome! I'm glad you're getting value out of it.

> I have been working on a matrix simulation (you know, the movie...)
> using this library. Atm, it renders on screen and animates correctly,
> but uses quite a bit of cpu when the frequency of renderings is
> several times a second. My question is, are you planning on improving
> the performance any time soon?

In my experience performance is best addressed as problems arise. In
this case there might be performance problems in brick or Vty. Is your
project source available? I would be happy to build it with profiling
and see if I can find out where the problem(s) are.

--
Jonathan Daugherty

Ismail s

unread,
Jul 29, 2016, 1:21:42 PM7/29/16
to Brick Users, cyg...@foobox.com
My code is public at https://gitlab.com/ismail-s/the-matrix-in-Haskell, but I develop it in the cloud at https://ide.c9.io/ismail_s/the-matrix-in-haskell. I've tried to share that workspace with you, so you can play around and run commands in it without having to clone my code, but due to a bug in cloud 9, you'll need to create an account on their website first (they support github auth) for me to do so.

Jonathan Daugherty

unread,
Sep 10, 2016, 11:09:14 PM9/10/16
to Ismail s, Brick Users
> My code is public at
> https://gitlab.com/ismail-s/the-matrix-in-Haskell, but I develop it in
> the cloud at https://ide.c9.io/ismail_s/the-matrix-in-haskell. I've
> tried to share that workspace with you, so you can play around and run
> commands in it without having to clone my code, but due to a bug in
> cloud 9, you'll need to create an account on their website first (they
> support github auth) for me to do so.

Hi again,

I had a chance to build and run your program, and although it uses
some CPU if I increase the "counter" frequency, it does okay on my
local machine. I see that you've updated it since posting your original
message; have you been able to get the performance you wanted?

--
Jonathan Daugherty

Ismail s

unread,
Oct 20, 2016, 7:09:45 PM10/20/16
to Jonathan Daugherty, Brick Users
Hi Jonathan,

Sorry for taking ages to reply. I was hoping to run my code on my laptop but haskell takes up too much space, which makes things a bit difficult, so I haven't bothered to do so.

I agree with you, performance seems to be ok if the counter frequency is set to be not too frequent. I think I'll probably make that be adjustable via the command line or something to let end users (of which there are probably none) adjust as they feel fit.

Thanks again, and good luck with brick. For creating command line interfaces it is very nice imo. Whilst there wasn't masses of documentation, the example programs, along with the guide you wrote gave me a decent understanding of how to do stuff. Also, fyi, I'm now trying to learn how to use Coq. Getting deeper into the rabbit hole of functional programming and expressive types.

Thanks,
Ismail

Jonathan Daugherty

unread,
Oct 20, 2016, 9:33:27 PM10/20/16
to Ismail s, Brick Users
> I agree with you, performance seems to be ok if the counter frequency
> is set to be not too frequent. I think I'll probably make that be
> adjustable via the command line or something to let end users (of
> which there are probably none) adjust as they feel fit.

If you find that you need to set it higher, at that point some profiling
reports would help pin down where the problem is.

> Thanks again, and good luck with brick. For creating command line
> interfaces it is very nice imo. Whilst there wasn't masses of
> documentation, the example programs, along with the guide you wrote
> gave me a decent understanding of how to do stuff.

I'm glad you're finding it useful! Since you mentioned documentation, if
there is specific documentation that would have been more helpful to you
than the User Guide, demo programs, and Haddock API documentation, I'd
love to know.

Thanks!

--
Jonathan Daugherty
Reply all
Reply to author
Forward
0 new messages