2021-08-10, updated: 2021-08-11

Tags: status.

Another week, another version

Another week, another version

By John Mercouris

Hello and welcome to another week of Atlas!

This week, development moves on to 3.0.0. Our goals for 3.0.0 are increased performance, refactoring for simplicity, and more features! In the following update we'll talk a little bit about how we're improving Nyxt's performance.

Background

Modern desktop computers are increasing their computational throughput via the introduction of more processors, more threads, and more parallelization. In order to take advantage of this, we've begun utilizing lparallel wherever applicable. Specifically, lparallel cognates.

What are Lparallel Cognates?

For those unfamiliar, lparallel cognates are lparallel versions of Common Lisp functions which areā€¦ parallelized. If that didn't make sense, here is a simplified example:

The above function will iterate through every single element in the list (list 0 1 2 3) and add 1. It will do this sequentially. You can imagine that the amount of time it takes for the above mapcar to complete is directly tied to the amount of elements it must process.

If we make a minor change and write:

Now, lparallel will process the elements in parallel. That is, if you have four processor cores, each core will add 1 to each element in the list. Theoretically, you could complete this operation in 1/4 of the original time. In practice, the performance gain is less due to thread management overhead. The difference is however still significant. On some operations we noticed that the processing time was more than halved!

The above approach works because operations like mapcar are functional. They map an operation over a list, a natural candidate for parallelization. They can easily take advantage of the many processor cores modern machines have.

This parallelization has resulted in a snappy prompt-buffer. We hope you enjoyed a little sneak peek into what we're working on. Thanks for reading, and have a nice week :-)