-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimization of memory usage in replace.c
* Add two fast paths that completely avoid the replacement machinery (these two fast paths were formerly present in 3.1); * Use a circular buffer instead of a list for the temporary queue of tokens in streams; * Do not reallocate tokens passed from the copy-replacing stream to the replace stream
- Loading branch information
lefessan
committed
Apr 27, 2024
1 parent
7b69950
commit 82100d6
Showing
4 changed files
with
372 additions
and
197 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,14 @@ | ||
|
||
2024-04-24 Fabrice Le Fessant <[email protected]> | ||
|
||
* replace.c: optimize speed and memory usage. For speed, we add two | ||
fast paths in cb_ppecho_copy_replace() to completely skip the | ||
replacement machinery if there is no need for it. For allocations, | ||
we only allocate tokens that are coming from the lexer (not the | ||
ones passed internally from the copy-replacing stream to the | ||
replace stream) and we use a circular buffer for the temporary | ||
queue of tokens instead of a list. | ||
|
||
2024-03-17 Fabrice Le Fessant <[email protected]> | ||
Emilien Lemaire <[email protected]> | ||
|
||
|
Oops, something went wrong.