-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Preallocate memory objects for pcc_thunk_chunk_t, pcc_lr_head_t, and …
…pcc_lr_answer_t A generated parser allocates memory objects for the types frequently. The objects are not resized so we can preallocate them. bencharmk.sh reports the code with this change is about 10~ faster than the original code in run times. benchmark.sh output for the original code: Generation times: ================= master calc 513 us (100%) json 511 us (100%) kotlin 2320 us (100%) Build times: ============ master calc 69 ms (100%) json 64 ms (100%) kotlin 731 ms (100%) Run times: ========== master calc 126 ms (100%) json 34 ms (100%) kotlin 279 ms (100%) benchmark.sh output for the code with this change: Generation times: ================= recycle-list calc 538 us (100%) json 512 us (100%) kotlin 2225 us (100%) Build times: ============ recycle-list calc 72 ms (100%) json 68 ms (100%) kotlin 732 ms (100%) Run times: ========== recycle-list calc 110 ms (100%) json 28 ms (100%) kotlin 222 ms (100%) Signed-off-by: Masatake YAMATO <yamato@redhat.com>
- Loading branch information
Showing
1 changed file
with
73 additions
and
6 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