Skip to content

Performance optimization - #1

Merged
renbaoshuo merged 9 commits into
renbaoshuo:masterfrom
yzqzss:perf
Aug 6, 2025
Merged

Performance optimization#1
renbaoshuo merged 9 commits into
renbaoshuo:masterfrom
yzqzss:perf

Conversation

@yzqzss

@yzqzss yzqzss commented Aug 6, 2025

Copy link
Copy Markdown
Contributor

Before:

cpu: 12th Gen Intel(R) Core(TM) i5-12450H
BenchmarkLexer/960.css.gz-12               14624             76186 ns/op               124.8 MiB/s         40640 B/op     1761 allocs/op
BenchmarkLexer/animate.css.gz-12            1374            887570 ns/op               101.7 MiB/s        612419 B/op    18777 allocs/op
BenchmarkLexer/blueprint.css.gz-12          7112            160003 ns/op               103.7 MiB/s         73504 B/op     3626 allocs/op
BenchmarkLexer/bootstrap-4.css.gz-12         536           2097289 ns/op                90.74 MiB/s      1271188 B/op    47858 allocs/op
BenchmarkLexer/bootstrap-5.css.gz-12         568           2194725 ns/op                89.04 MiB/s      1296619 B/op    48388 allocs/op
BenchmarkLexer/font-awesome-all.css.gz-12                   1764            678521 ns/op               102.8 MiB/s      374017 B/op      15512 allocs/op
BenchmarkLexer/foundation.css.gz-12                          711           1722624 ns/op                92.26 MiB/s      1024611 B/op      40907 allocs/op
BenchmarkLexer/inuit.css.gz-12                              4370            314816 ns/op               160.6 MiB/s        149043 B/op       5444 allocs/op
BenchmarkLexer/normalize.css.gz-12                         36096             31776 ns/op               184.0 MiB/s         12640 B/op        520 allocs/op
BenchmarkLexer/pure.css.gz-12                               5348            247496 ns/op               111.1 MiB/s        133200 B/op       5013 allocs/op
BenchmarkLexer/reset.css.gz-12                             87961             13562 ns/op                76.28 MiB/s         5504 B/op        304 allocs/op
BenchmarkLexer/tailwind.css.gz-12                             60          21809385 ns/op               103.9 MiB/s      16030122 B/op     491444 allocs/op

After:

cpu: 12th Gen Intel(R) Core(TM) i5-12450H
BenchmarkLexer/960.css.gz-12               27336             46168 ns/op               206.0 MiB/s            65 B/op          0 allocs/op
BenchmarkLexer/animate.css.gz-12            2169            515651 ns/op               176.1 MiB/s           520 B/op          1 allocs/op
BenchmarkLexer/blueprint.css.gz-12         13356             90538 ns/op               182.8 MiB/s           110 B/op          0 allocs/op
BenchmarkLexer/bootstrap-4.css.gz-12        1023           1081599 ns/op               176.2 MiB/s           997 B/op          2 allocs/op
BenchmarkLexer/bootstrap-5.css.gz-12        1117           1089872 ns/op               179.1 MiB/s          1034 B/op          2 allocs/op
BenchmarkLexer/font-awesome-all.css.gz-12                   3196            370056 ns/op               187.7 MiB/s           433 B/op          1 allocs/op
BenchmarkLexer/foundation.css.gz-12                         1219            940975 ns/op               170.0 MiB/s           776 B/op          1 allocs/op
BenchmarkLexer/inuit.css.gz-12                              6634            183621 ns/op               275.8 MiB/s           250 B/op          0 allocs/op
BenchmarkLexer/normalize.css.gz-12                         61032             20811 ns/op               281.1 MiB/s            48 B/op          0 allocs/op
BenchmarkLexer/pure.css.gz-12                               8744            129488 ns/op               212.0 MiB/s           145 B/op          0 allocs/op
BenchmarkLexer/reset.css.gz-12                            152024              7852 ns/op               132.4 MiB/s            27 B/op          0 allocs/op
BenchmarkLexer/tailwind.css.gz-12                            100          10623154 ns/op               213.7 MiB/s          2378 B/op          7 allocs/op

Comment thread tests/bench/bench_test.go Outdated
Comment thread tests/bench/bench_test.go Outdated
Comment thread util.go Outdated
@renbaoshuo
renbaoshuo merged commit 59c1edb into renbaoshuo:master Aug 6, 2025
3 checks passed
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