Skip to content

Commit ba8ee8d

Browse files
CybotTMclaude
andcommitted
docs: Add Phase 2 async architecture and real performance test results
- Phase2-AsyncImportArchitecture.md: Complete Symfony Messenger design - RealPerformanceResults.md: Document PR #55 optimization failure - generate-textdb-import.php: Test file generator utility Real testing showed database optimization made performance worse: - Small files (3K): 24% faster - Large files (400K): 5.8% slower Phase 2 will implement proper async queue with Symfony Messenger and DBAL bulk inserts after profiling confirms bottleneck. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 7f6b9db commit ba8ee8d

File tree

3 files changed

+1197
-0
lines changed

3 files changed

+1197
-0
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/usr/bin/env php
2+
<?php
3+
declare(strict_types=1);
4+
5+
/**
6+
* Generate large textdb_import XLIFF file for performance testing
7+
*/
8+
9+
$count = (int) ($argv[1] ?? 3000);
10+
$output = $argv[2] ?? '/home/cybot/projects/t3x-nr-textdb/Resources/Private/Language/perftest.textdb_import.xlf';
11+
12+
echo "Generating $count trans-units to $output\n";
13+
14+
$xml = '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
15+
$xml .= '<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">' . "\n";
16+
$xml .= ' <file source-language="en" datatype="plaintext" original="messages" date="2024-11-14T00:00:00Z" product-name="nr_textdb">' . "\n";
17+
$xml .= ' <header/>' . "\n";
18+
$xml .= ' <body>' . "\n";
19+
20+
$components = ['auth', 'user', 'admin', 'content', 'navigation', 'form', 'table', 'modal', 'notification', 'dashboard'];
21+
$types = ['label', 'button', 'message', 'title', 'description', 'placeholder', 'tooltip', 'error', 'warning', 'success'];
22+
23+
for ($i = 0; $i < $count; $i++) {
24+
$component = $components[$i % count($components)];
25+
$type = $types[($i >> 1) % count($types)];
26+
$placeholder = sprintf('item_%d', $i);
27+
28+
$id = "$component|$type|$placeholder";
29+
$source = "Source text $i";
30+
$target = "Target translation $i - Lorem ipsum dolor sit amet, consectetur adipiscing elit";
31+
32+
$xml .= sprintf(' <trans-unit id="%s">' . "\n", htmlspecialchars($id));
33+
$xml .= sprintf(' <source>%s</source>' . "\n", htmlspecialchars($source));
34+
$xml .= sprintf(' <target>%s</target>' . "\n", htmlspecialchars($target));
35+
$xml .= ' </trans-unit>' . "\n";
36+
}
37+
38+
$xml .= ' </body>' . "\n";
39+
$xml .= ' </file>' . "\n";
40+
$xml .= '</xliff>' . "\n";
41+
42+
file_put_contents($output, $xml);
43+
44+
echo "Generated: " . number_format(strlen($xml)) . " bytes (" . number_format($count) . " trans-units)\n";
45+
echo "File size: " . number_format(filesize($output)) . " bytes\n";

0 commit comments

Comments
 (0)