Bogdan Popa writes:
> Ah! You're right. When I make the change you suggest, the program
> takes 5s to run. Filed under "Accidentally Not Quadratic" 😅.
The program actually takes 2.5s to run. I missed the fact that I had
made two separate calls to `string-append!` i
Matthew Flatt writes:
> At Sun, 27 Jun 2021 21:36:09 +0300, Bogdan Popa wrote:
> Your program does run fast on my machine, but I think it's because this
> line doesn't have the intended bad effect:
>
>> (string-copy! dst 0 dst 0 len) ;; intent
While I think the complexity piece is important, I feel like it's worth
pointing out just how much more expensive the allocation -- and its
ramifications, like the resulting GC pressure and CPU cache misses -- is
than one might think. Here's a quadratic version of the code that
avoids allocations:
ring.rkt
>/dev/null
Bogdan Popa writes:
> Hi Alessandro,
>
> Here is a version of your program that is about 30 times faster on my
> machine (9s -> 300ms):
>
> #lang racket/base
>
> (require racket/flonum
> racket/format
> rack
Hi Alessandro,
Here is a version of your program that is about 30 times faster on my
machine (9s -> 300ms):
#lang racket/base
(require racket/flonum
racket/format
racket/port)
(define (xy-vectors->string x-vec y-vec)
(call-with-output-string
(l
kamist...@gmail.com writes:
> (So I guess the only question that comes up is: is it possible to update
> the sqlite version?)
> [vaguely remember seeing a mailing list thread about this but, currently I
> only find other ones]
My libsqlite3[1] package provides recent versions (currently 3.35.5)
/7fc52e7bdc327fb59c8858a42258c26a
>> >>
>> >> Sam
>> >>
>> >> On Fri, Mar 19, 2021 at 7:21 AM Sam Tobin-Hochstadt
>> >> wrote:
>> >> >
>> >> > One minor additional suggestion: if you use
p at all (probably CS
> recognizes the vectors and all those refs are inlined anyway).
>
>
> Cheers,
> Dominik
>
> [1] https://xkcd.com/386/
> [2] http://phdcomics.com/comics/archive.php?comicid=1735
> [3] https://gist.github.com/dzoep/0e081d0544afac539a4829179c601e0e
>
>
I updated the gist with some cleanups and additional improvements that
get the runtime down to a little over 1s (vs ~350ms for the optimized C
and Rust code) on my maxed-out 2019 MBP and ~600ms on my M1 Mac Mini.
Pawel Mosakowski writes:
> Hi Bogdan,
>
> This is a brilliant solution and also comp
I managed to get it about as fast as Python by making it really
imperative and rolling my own hash:
https://gist.github.com/Bogdanp/fb39d202037cdaadd55dae3d45737571
Sam Tobin-Hochstadt writes:
> Here are several variants of the code:
> https://gist.github.com/d6fbe3757c462d5b4d1d9393b72f9ab9
>
>
Round 20 was recently published and Racket's score improved, as expected:
https://www.techempower.com/benchmarks/#section=data-r20&hw=ph&test=composite
We're now beating many of the popular frameworks in the composite scores
and I think there are still plenty of improvements that could be made.
nue to be built on Precise.
>
> But CS will also be built on Xenial --- mostly because that build is
> set up, but maybe it's a step toward migrating the build.
>
> At Wed, 12 Aug 2020 10:17:15 +0300, Bogdan Popa wrote:
>> Thanks for the heads-up! Will CS continue to be bui
Thanks for the heads-up! Will CS continue to be built on Xenial and BC
on Precise?
Matthew Flatt writes:
> As you may know, the Racket Git repo recently switched to Racket CS as
> the default build. That is, if you check out the repo and `make`, then
> you get an in-place Racket CS build instead
George Neuner writes:
> Multiple Racket applications *should* all be able to listen on the
> same port without having been spawned from the same ancestor process.
> If that isn't working now, something has gotten hosed.
I don't know whether this used to work in the past or not, but currently
on
Alex Harsanyi writes:
> Question 1: Based on this benchmark, is there any reason to chose anything
> else but "drogon"? Even if one chooses the second best on that list, which
> is "actix", they already loose about 6% performance and things degrade
> quickly afterwards. The framework at positi
Yury Bulka writes:
> Wow, from 695 requests per second to 49,516 is a huge improvement!
>
> Since we were comparing to django previously, it's now much closer with
> django (which does 78,132 rps.)
I expect the Racket benchmark will do even better on TechEmpower's hw
than it did on mine because
Small update on this: I've updated the benchmarks to run multiple Racket
processes with an Nginx load balancer in front. After some tuning[1], here
is what the results look like on my 12 core AMD Ryzen 9 3900 server:
https://www.techempower.com/benchmarks/#section=test&shareid=669bfab7-9242-4c26-
The reason for the poor performance relative to the other langs/frameworks is
that there is currently no easy way to take advantage of multiple cores using
the web framework so what’s being benchmarked is single core perf. This is
mainly a problem for benchmarks such as this, but not really an i
Bogdan Popa writes:
> Only dispatchers get direct access to the output port for the socket.
> If you use `dispatch/servlet', then it takes care of taking your
> `response' value and calling `output-response' on it. Unless the server
> knows the connection shou
George Neuner writes:
> What I did say is that Python's threads are core limited - and *that*
> is true. As a technical matter, Python *may* in fact start threads
> on different cores, but the continual need to take the GIL quickly
> forces every running thread in the process onto the same core.
George Neuner writes:
> But Python's DB pool is threaded, and Python's threads are core
> limited by the GIL in all the major implementations (excepting
> Jython).
Python's Postgres pooling does not[1] use POSIX threads under the hood
to manage the connections if that's what you mean, nor is th
I replied earlier today off of my Phone, but, for whatever reason
(caught in the moderation queue?), it's not showing up in this thread.
Here's what it said:
The reason for poor performance relative to the other
langs/frameworks is that there is currently no easy way to take
advantage of
Norman Gray writes:
> But what happens in this case (the my-app/error case in my example) is
> that the (server) program keeps going but the client stalls. The
> unexpected error in the response-output procedure is caught, and (as
> far as I can see) handled by killing the producer thread _with
Sage Gerard writes:
> As long as I don't have to keep reorganizing my code to accommodate
> the tooling, then it's a night and day improvement. Would you mind
> terribly if I worked with you? I was mulling over this myself in the
> dev list, but I am happy to aid any existing effort.
I'd apprecia
Sam Tobin-Hochstadt writes:
> This is very cool! One question -- for "main-distribution" packages,
> are you snapshotting the most-recent release catalog? Or
> pkgs.racket-lang.org? The latter is simpler, but the former is
> probably needed to make the examples in the README work. Otherwise,
> i
Alex Harsanyi writes:
> As an application writer, I am on the other side of this problem, by
> depending on other packages. Having limited time to work on my project I
> want to upgrade package dependencies at my own pace.
I'm in a similar position since I operate a few Racket applications.
I'
I solved this in koyo by defining an alternate version[1] of
`dispatch-rules' whose generated `reverse-uri' functions take route
names rather than functions as arguments:
https://koyoweb.org/dispatch/index.html#%28form._%28%28lib._koyo%2Fdispatch..rkt%29._dispatch-rules%2Broles%29%29
The generate
I'd recommend using `prefix-in' with the dispatcher modules, as that
avoids these types of issues altogether:
(require (prefix-in files: web-server/dispatchers/dispatch-files)
(prefix-in sequencer: web-server/dispatchers/dispatch-sequencer))
(sequencer:make
(files:make .
Jon Zeppieri writes:
> When you stream the response, it doesn't use a chunked transfer encoding? -Jon
The web server chunks all responses on HTTP/1.1 connections[1].
I can confirm that the web server works great[2] for streaming uses cases
like long polling!
[1]:
https://github.com/racket/we
The version of the web-server that will be included with Racket 7.6
changes the way file uploads are handled so that they get offloaded to
disk after a certain threshold (similar to how that nginx module you
linked to works).
You can check out the pre-release docs for details:
*
https://pre-rele
Jens Axel Søgaard writes:
> But I haven't implemented "reset password" functionality yet. I need
> to figure out how best to handle sending mails from a server. My
> concern is being flagged for spamming - so I don't dare use my normal
> mail.
I like using Postmark[0] for this. Their free plan
James Platt writes:
> Would this now be the preferred method to include a copy of the SQLite
> library. required by the DB module, to your distribution? The
> software I am working on requires a newer version of SQLite than is
> included in at least some of the operating systems we want to supp
> (The issue was that some of the packages had started to take advantage of a
> feature of the dependencies list in info.rkt that allowed regular
> expressions in the platform restriction clause. When it came time for the
> indexer to convert the dependencies list to JSON, it failed because it
>
This is fantastic news! Thank you!
Stephen Chang writes:
> The RacketScript compiler [1] has been updated to work with Racket 7.x
> programs, ie all tests pass (though we are still working to support
> more primitives).
>
> Try it out here: http://rapture.twistedplane.com:8080/
>
> The next mile
This is great! Thank you.
Roman Klochkov writes:
> Now we have gettext: https://docs.racket-lang.org/gettext/index.html
>
> суббота, 9 февраля 2019 г., 18:56:59 UTC+5 пользователь cwebber написал:
>>
>> How are people currently translating their programs?
>> I expected to see a gettext library o
Marc Kaufmann writes:
> So the easiest to do is to create such an info.rkt file and call `raco pkg
> install app-name/` -- and that should work even if I don't do the `raco
> exe` and `raco distribute`?
Yes, that's right. `raco exe' and `raco distribute' are not required.
I realize now that I
Alex Harsanyi writes:
>> Although it's not exactly the same thing, I use `info.rkt'[1][2]
>> (similar to `setup.py') for this purpose and each one of
>> my web apps is its own package.
>>
>
> Does this mean that the application itself is available as a package and
> you can require files from in
Marc Kaufmann writes:
> this is surely answered somewhere, but I have not made much progress. If
> you know python, what I want to do is essentially
>
> $ pip install requirements.txt
>
Although it's not exactly the same thing, I use `info.rkt'[1][2]
(similar to `setup.py') for this purpose and
> I haven't been able to find a persistent job queue for Racket, so I thought
> I'd ask if one exists before writing a simple one. I did see Jay's job
> queue package, but it doesn't appear to persist to disk, and that is a
> requirement.
FWIW, I am working on a new Redis client package[1] that
Sage Gerard writes:
> - unlike-assets: A build tool for interdependent assets. Similar to Webpack,
> if you are familiar with the JS ecosystem.
Cool stuff! I was very close to building an asset pipeline for koyo[1]
a couple months ago, but I settled on just using broccoli.js instead.
I'm glad t
> When I want to enable these private contracts (e.g. when running tests or
> debugging a problem) I simply change the source code of `def/c` so that it
> is wired up to `define/contract` and the contract is checked. Here is an
> example: http://pasterack.org/pastes/4224
You can run arbitrary co
> Is it OK to wrap declare-bundle! + store-bundle inside (begin-for-syntax
> ...) to make side effect during raco setup? If not, what is preferred way
> to do it?
Is there any reason not to do it at runtime? This[1] is what I do in
forms-lib. Other modules depend on that module so the bundles ar
In case someone sets out to do this, here are some things I have open
sourced (from my closed source projects) in the web space that may help:
* koyo[1]: a general toolking built on top of web-server-lib that adds
many of the things you need in a real web application (CSRF, CORS,
databas
Hey everybody!
I just wrote `marionette`, a library that lets you control the Firefox
web browser from Racket and I figured I'd share it!
* the source code is here: https://github.com/bogdanp/marionette,
* you can install the package by running `raco pkg install marionette` and
* the docs will be
> How are people currently translating their programs?
I was searching for a way to do l10n yesterday[1] and the best I could
find was SRFI 29[2] from srfi-lib.
[1]:
https://github.com/Bogdanp/racket-webapp-template/commit/7647b2f2f460d1ede4f468e00f4dea62a541ee6e#diff-9978fbdfa51cde9daace605e8
Hey all,
I needed a web form validation library last week and web-server-lib's
formlets don't, afaict, provide any facilities for collecting and
displaying validation errors to the end user so I made "forms" to
scratch that particular itch. I hope it proves useful to some of you!
Documentation
Brian Adkins writes:
> I just did a quick test, and "kill " will stop the Racket web server,
> but not gracefully. In other words, it doesn't allow the current request to
> finish. Maybe another signal will gracefully stop it?
I personally run the server with serve[1] which runs it in a backgro
One way you might also solve this on UNIX systems is you could fork after
listening on the socket. The file descriptor for the socket from the parent
would then be shared with the children and so their accept calls would be "load
balanced" by way of them all accepting connections from the same q
48 matches
Mail list logo