Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[66_5] Perf tuning on tm_reader::decode via index_of #1649

Closed
wants to merge 12 commits into from

Conversation

da-liii
Copy link
Contributor

@da-liii da-liii commented Feb 15, 2024

Why you open this Pull Request?

as title describe

What work have you done in the current Pull Request?

For 5m tm doc: 564ms -> 543ms

@da-liii da-liii changed the title [66_5] Perf tuning on tm_reader::decode [66_5] Perf tuning on tm_reader::decode use index_of Feb 15, 2024
@da-liii da-liii changed the title [66_5] Perf tuning on tm_reader::decode use index_of [66_5] Perf tuning on tm_reader::decode via index_of Feb 15, 2024
Copy link
Contributor

@jingkaimori jingkaimori left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

further optimization can be done, and qtest has facilities for benchmark:

https://doc.qt.io/qt-6/qttestlib-tutorial5-example.html

src/Data/Convert/Texmacs/fromtm.cpp Outdated Show resolved Hide resolved
@da-liii
Copy link
Contributor Author

da-liii commented Feb 16, 2024

and qtest has facilities for benchmark:

we do not need micro bench here.

This reverts commit fb9960d.
This reverts commit 8d92d86.
@da-liii
Copy link
Contributor Author

da-liii commented Feb 16, 2024

Tested on Linux using sicp.tm (3.25M), there is no significant performance improvements.

@jingkaimori
Copy link
Contributor

Performance is slightly improved:

Before:

PASS   : TestConverter::test_texmacs_to_tree_bench(29_1_1.tm)
RESULT : TestConverter::test_texmacs_to_tree_bench():"29_1_1.tm":
     0.018 msecs per iteration (total: 76, iterations: 4096)
PASS   : TestConverter::test_texmacs_to_tree_bench(46_3.tm)
RESULT : TestConverter::test_texmacs_to_tree_bench():"46_3.tm":
     0.394 msecs per iteration (total: 101, iterations: 256)
PASS   : TestConverter::test_texmacs_to_tree_bench(64_1.tm)
RESULT : TestConverter::test_texmacs_to_tree_bench():"64_1.tm":
     1.5 msecs per iteration (total: 98, iterations: 64)

After:

PASS   : TestConverter::test_texmacs_to_tree_bench(29_1_1.tm)
RESULT : TestConverter::test_texmacs_to_tree_bench():"29_1_1.tm":
     0.016 msecs per iteration (total: 69, iterations: 4096)
PASS   : TestConverter::test_texmacs_to_tree_bench(46_3.tm)
RESULT : TestConverter::test_texmacs_to_tree_bench():"46_3.tm":
     0.37 msecs per iteration (total: 95, iterations: 256)
PASS   : TestConverter::test_texmacs_to_tree_bench(64_1.tm)
RESULT : TestConverter::test_texmacs_to_tree_bench():"64_1.tm":
     1.4 msecs per iteration (total: 92, iterations: 64)

@da-liii
Copy link
Contributor Author

da-liii commented Feb 16, 2024

剩下的单元测试和注释,我来加一下吧

@da-liii da-liii marked this pull request as draft February 16, 2024 10:21
Copy link
Contributor

@jingkaimori jingkaimori left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jingkaimori jingkaimori marked this pull request as ready for review February 27, 2024 10:09
@jingkaimori
Copy link
Contributor

Modification should not be make on parser of tm. tmu parser needs these optimization.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants