View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0006199 | Taler | exchange | public | 2020-04-22 13:30 | 2021-09-02 18:14 |
Reporter | fefe | Assigned To | Christian Grothoff | ||
Priority | normal | Severity | trivial | Reproducibility | have not tried |
Status | closed | Resolution | fixed | ||
Product Version | 0.7.0 | ||||
Target Version | 0.8 | Fixed in Version | 0.8 | ||
Summary | 0006199: loading the terms of service files into memory seems wasteful | ||||
Description | This is about load_terms in exchange/src/mhd/mhd_legal.c. Basically, the function loads a bunch of files into memory. Does a stat to find the length, then mallocs that much (without bounds!) and reads the file contents into that buffer. These files will usually not be very large so it probably does not matter much. However, I would suggest using mmap instead of malloc+read. In both cases you get a pointer, but it puts less strain on the OS and the memory usage of your application. | ||||
Tags | No tags attached. | ||||
|
If we REALLY cared about performance, we could even use MHD's sendfile() here, but then we'd burn an fd per ToS/PP-file. |
|
Moreover, if we REALLY care about performance, we should probably keep the compressed response in RAM instead of re-doing the compression per request. That'll be worse for RAM, but almost certainly beats re-doing gzip all the time. |
|
Implemented in d9e871b5..6d52922c |
|
Fix committed to master branch. |
Date Modified | Username | Field | Change |
---|---|---|---|
2020-04-22 13:30 | fefe | New Issue | |
2020-04-22 13:30 | fefe | Status | new => assigned |
2020-04-22 13:30 | fefe | Assigned To | => Christian Grothoff |
2020-04-22 15:07 | Christian Grothoff | Note Added: 0015730 | |
2020-04-22 22:48 | Christian Grothoff | Note Added: 0015738 | |
2020-04-22 23:14 | Christian Grothoff | Assigned To | Christian Grothoff => |
2020-04-22 23:14 | Christian Grothoff | Status | assigned => confirmed |
2020-04-22 23:14 | Christian Grothoff | Target Version | => 0.9 |
2020-07-16 15:17 | Christian Grothoff | Assigned To | => Christian Grothoff |
2020-07-16 15:17 | Christian Grothoff | Status | confirmed => assigned |
2020-07-21 21:33 | Christian Grothoff | Note Added: 0016494 | |
2020-07-21 21:33 | Christian Grothoff | Status | assigned => resolved |
2020-07-21 21:33 | Christian Grothoff | Resolution | open => fixed |
2020-07-21 21:33 | Christian Grothoff | Fixed in Version | => 0.8 |
2020-07-21 21:33 | Christian Grothoff | Target Version | 0.9 => 0.8 |
2021-08-24 16:23 | Christian Grothoff | Status | resolved => closed |
2021-09-02 18:13 | Christian Grothoff | Changeset attached | => Taler-exchange master 6d52922c |
2021-09-02 18:14 | Christian Grothoff | Note Added: 0018248 |