Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Attempt for optimization using bytestring (#24).
ByteString
and feed it toAlex
directly without going throughString
(Note thatAlex
internally uses UTF-8),Builder
instead ofShowS
.V
,AtomicWord
,Role
,DistinctObjectTerm
)Compatibility is kept to some extent using
PatternSynonyms
extension.As I show below, maximum residency is reduced significantly, but I'm still not sure if it is worth its implementation complexity.
Experiments
I compiled
TestImportExportImportFile
using GHC 8.6.5 + Stackage LTS 14.20 usingstack build --executable-profiling --flag logic-TPTP:BuildTestPrograms
, and ranecho TPTP-v7.3.0/Problems/HWV/HWV122-1.p | TestImportExportImportFile False +RTS -p -s
onmaster
(4ef0ec9) and on thisbytestring
branch (6cb34a6) three times for each and take average of profile information.Result
Time/allocation profile (
-p
):Summary GC statistics (
-s
):Discussion
Total allocation increased a little (+11.6 %). I guess this is caused by increased conversion between types.
On the other hands, maximum residency is reduced significantly (-41.9 %).
Execution time is reduced a little (-4.3 %), but this may be by chance.