Skip to content

Commit 9711cb7

Browse files
authored
Tune/cycle counts & refresh UI (#37)
* Tune cycle counts to reduce total benchmark time from ~19s to ~6s Lower defaults for JSON (9999→1000), Hashing (99999→9999), and Serialization (9999→2000) to keep each module under ~2s while still producing meaningful timings. * Redesign HTML dashboard with dark theme and polished styling Dark navy background, cyan accents, green monospace values, hover effects on cards/rows/badges, refined typography with JetBrains Mono, and subtle header glow line.
1 parent 6838799 commit 9711cb7

5 files changed

Lines changed: 127 additions & 59 deletions

File tree

config/config.yml.example

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ benchmark:
2020
- github.com
2121
json:
2222
enabled: true
23-
count: 9999
23+
count: 1000
2424
regex:
2525
enabled: true
2626
count: 99999
@@ -29,10 +29,10 @@ benchmark:
2929
cycles: 100
3030
serialization:
3131
enabled: true
32-
count: 9999
32+
count: 2000
3333
hashing:
3434
enabled: true
35-
hashCount: 99999
35+
hashCount: 9999
3636
passwordCount: 10
3737
encryption:
3838
enabled: true

src/Modules/Hashing.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
class Hashing implements BenchmarkModuleInterface
1111
{
12-
private static int $defaultHashCount = 99999;
12+
private static int $defaultHashCount = 9999;
1313
private static int $defaultPasswordCount = 10;
1414

1515
/** @var list<string> */

src/Modules/Json.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
class Json implements BenchmarkModuleInterface
1111
{
12-
private static int $defaultCount = 9999;
12+
private static int $defaultCount = 1000;
1313

1414
public function __construct(private readonly Config $config) {}
1515

src/Modules/Serialization.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
class Serialization implements BenchmarkModuleInterface
1111
{
12-
private static int $defaultCount = 9999;
12+
private static int $defaultCount = 2000;
1313

1414
public function __construct(private readonly Config $config) {}
1515

src/Renderer/HtmlRenderer.php

Lines changed: 121 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -430,110 +430,178 @@ private function css(): string
430430
return <<<'CSS'
431431
* { margin: 0; padding: 0; box-sizing: border-box; }
432432
body {
433-
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
434-
background: #f0f2f5;
435-
color: #1a1a2e;
433+
font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
434+
background: #1a1f2e;
435+
color: #c8ccd4;
436436
line-height: 1.6;
437+
min-height: 100vh;
437438
}
438439
.banner {
439-
background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
440-
color: #fff;
441-
padding: 2rem;
440+
background: linear-gradient(160deg, #1e2536 0%, #1a1f2e 50%, #1c2233 100%);
441+
border-bottom: 1px solid rgba(56, 189, 248, 0.1);
442+
color: #e2e8f0;
443+
padding: 3rem 2rem 2.5rem;
442444
text-align: center;
445+
position: relative;
446+
overflow: hidden;
447+
}
448+
.banner::before {
449+
content: "";
450+
position: absolute;
451+
top: 0;
452+
left: 50%;
453+
transform: translateX(-50%);
454+
width: 600px;
455+
height: 1px;
456+
background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.5), transparent);
457+
}
458+
.banner h1 {
459+
font-size: 1.5rem;
460+
font-weight: 700;
461+
letter-spacing: -0.02em;
462+
color: #f1f5f9;
463+
}
464+
.banner .meta {
465+
margin-top: 0.75rem;
466+
display: flex;
467+
justify-content: center;
468+
gap: 2rem;
469+
font-size: 0.875rem;
470+
color: #64748b;
471+
}
472+
.banner .duration {
473+
font-family: "JetBrains Mono", "SF Mono", "Cascadia Code", monospace;
474+
color: #38bdf8;
475+
font-weight: 500;
443476
}
444-
.banner h1 { font-size: 1.8rem; font-weight: 600; }
445-
.banner .meta { margin-top: 0.5rem; opacity: 0.8; display: flex; justify-content: center; gap: 2rem; }
446-
.banner .duration { font-family: "SF Mono", "Cascadia Code", monospace; color: #4ecca3; }
447477
.grid {
448478
display: grid;
449-
grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
450-
gap: 1.5rem;
451-
padding: 2rem;
452-
max-width: 1400px;
479+
grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
480+
gap: 1rem;
481+
padding: 1.5rem;
482+
max-width: 1440px;
453483
margin: 0 auto;
454484
}
455485
.card {
456-
background: #fff;
457-
border-radius: 12px;
458-
box-shadow: 0 2px 8px rgba(0,0,0,0.08);
486+
background: #232a3b;
487+
border: 1px solid #2e3648;
488+
border-radius: 10px;
459489
overflow: hidden;
490+
transition: border-color 0.2s ease;
460491
}
492+
.card:hover { border-color: #3a4358; }
461493
.card-wide { grid-column: 1 / -1; }
462494
.card-title {
463-
background: #1a1a2e;
464-
color: #4ecca3;
465-
padding: 0.75rem 1.25rem;
495+
background: linear-gradient(180deg, #283044 0%, #232a3b 100%);
496+
border-bottom: 1px solid #2e3648;
497+
color: #38bdf8;
498+
padding: 0.7rem 1.25rem;
499+
font-weight: 600;
500+
font-size: 0.8rem;
501+
text-transform: uppercase;
502+
letter-spacing: 0.08em;
503+
}
504+
.card-body { padding: 1.25rem; }
505+
.card-body h3 {
506+
margin: 1.25rem 0 0.5rem;
507+
color: #94a3b8;
508+
font-size: 0.8rem;
466509
font-weight: 600;
467-
font-size: 0.95rem;
468510
text-transform: uppercase;
469511
letter-spacing: 0.05em;
470512
}
471-
.card-body { padding: 1.25rem; }
472-
.card-body h3 { margin: 1rem 0 0.5rem; color: #16213e; font-size: 0.95rem; }
473-
.card-body h3 small { color: #888; font-weight: 400; }
513+
.card-body h3 small { color: #475569; font-weight: 400; text-transform: none; letter-spacing: 0; }
474514
.card-body h3:first-child { margin-top: 0; }
475-
dl.kv { display: grid; grid-template-columns: auto 1fr; gap: 0.3rem 1rem; }
476-
dl.kv dt { color: #666; font-size: 0.9rem; }
477-
dl.kv dd { font-family: "SF Mono", "Cascadia Code", monospace; font-size: 0.9rem; color: #1a1a2e; }
515+
dl.kv { display: grid; grid-template-columns: auto 1fr; gap: 0.4rem 1.25rem; }
516+
dl.kv dt { color: #64748b; font-size: 0.85rem; }
517+
dl.kv dd {
518+
font-family: "JetBrains Mono", "SF Mono", "Cascadia Code", monospace;
519+
font-size: 0.85rem;
520+
color: #e2e8f0;
521+
}
478522
table {
479523
width: 100%;
480524
border-collapse: collapse;
481525
margin: 0.5rem 0 1rem;
482-
font-size: 0.85rem;
526+
font-size: 0.8rem;
483527
}
484528
table th {
485-
background: #f0f2f5;
486-
padding: 0.5rem 0.75rem;
529+
background: #1e2536;
530+
padding: 0.55rem 0.75rem;
487531
text-align: left;
488532
font-weight: 600;
489-
color: #16213e;
490-
border-bottom: 2px solid #ddd;
533+
color: #94a3b8;
534+
border-bottom: 1px solid #2e3648;
535+
font-size: 0.75rem;
536+
text-transform: uppercase;
537+
letter-spacing: 0.03em;
491538
}
492539
table td {
493-
padding: 0.5rem 0.75rem;
494-
border-bottom: 1px solid #eee;
495-
font-family: "SF Mono", "Cascadia Code", monospace;
496-
color: #2d6a4f;
540+
padding: 0.55rem 0.75rem;
541+
border-bottom: 1px solid #2a3140;
542+
font-family: "JetBrains Mono", "SF Mono", "Cascadia Code", monospace;
543+
color: #4ade80;
544+
font-size: 0.8rem;
497545
}
498546
table tr:last-child td { border-bottom: none; }
499-
.subtitle { color: #888; font-size: 0.9rem; margin-bottom: 0.75rem; }
547+
table tr:hover td { background: rgba(56, 189, 248, 0.03); }
548+
.subtitle {
549+
color: #475569;
550+
font-size: 0.8rem;
551+
margin-bottom: 0.75rem;
552+
}
500553
details { margin-top: 1rem; }
501554
summary {
502555
cursor: pointer;
503-
color: #16213e;
556+
color: #94a3b8;
504557
font-weight: 500;
505-
font-size: 0.9rem;
558+
font-size: 0.85rem;
506559
padding: 0.3rem 0;
560+
transition: color 0.15s;
507561
}
562+
summary:hover { color: #e2e8f0; }
508563
.ext-list {
509564
display: flex;
510565
flex-wrap: wrap;
511-
gap: 0.4rem;
566+
gap: 0.35rem;
512567
margin-top: 0.5rem;
513568
}
514569
.ext {
515-
background: #f0f2f5;
516-
padding: 0.2rem 0.6rem;
517-
border-radius: 4px;
518-
font-size: 0.8rem;
519-
font-family: "SF Mono", "Cascadia Code", monospace;
520-
}
521-
.ext small { color: #888; }
570+
background: #2a3140;
571+
border: 1px solid #353e50;
572+
padding: 0.15rem 0.5rem;
573+
border-radius: 5px;
574+
font-size: 0.75rem;
575+
font-family: "JetBrains Mono", "SF Mono", "Cascadia Code", monospace;
576+
color: #c8ccd4;
577+
transition: border-color 0.15s;
578+
}
579+
.ext:hover { border-color: #38bdf8; }
580+
.ext small { color: #475569; }
522581
footer {
523582
text-align: center;
524583
padding: 1.5rem 2rem;
525-
color: #888;
526-
font-size: 0.85rem;
584+
color: #475569;
585+
font-size: 0.8rem;
527586
display: flex;
528587
justify-content: center;
529588
gap: 2rem;
589+
border-top: 1px solid #2a3140;
590+
margin-top: 0.5rem;
591+
}
592+
footer strong { color: #94a3b8; }
593+
footer code {
594+
background: #2a3140;
595+
border: 1px solid #353e50;
596+
padding: 0.1rem 0.4rem;
597+
border-radius: 4px;
598+
font-family: "JetBrains Mono", "SF Mono", "Cascadia Code", monospace;
599+
color: #94a3b8;
530600
}
531-
footer strong { color: #1a1a2e; }
532-
footer code { background: #f0f2f5; padding: 0.1rem 0.4rem; border-radius: 3px; }
533601
@media (max-width: 600px) {
534-
.grid { grid-template-columns: 1fr; padding: 1rem; gap: 1rem; }
535-
.banner { padding: 1.5rem 1rem; }
536-
.banner h1 { font-size: 1.4rem; }
602+
.grid { grid-template-columns: 1fr; padding: 1rem; gap: 0.75rem; }
603+
.banner { padding: 2rem 1rem 1.5rem; }
604+
.banner h1 { font-size: 1.3rem; }
537605
footer { flex-direction: column; gap: 0.5rem; }
538606
}
539607
CSS;

0 commit comments

Comments
 (0)