@@ -274,57 +274,6 @@ func loadSampleFile(_ name: String) throws -> String {
274274 print ( String ( format: " Speedup (UTF-8 vs char): %.1fx " , charIterMs / utf8IterMs) )
275275}
276276
277- @Test func profileEntityDecoding( ) async throws {
278- print ( " \n " + String( repeating: " = " , count: 70 ) )
279- print ( " ENTITY DECODING ANALYSIS " )
280- print ( String ( repeating: " = " , count: 70 ) )
281-
282- // Generate entity-heavy HTML
283- var entityHtml = " <!DOCTYPE html><html><body> "
284- for i in 0 ..< 1000 {
285- entityHtml +=
286- " <p>Test \( i) : & < > " < > © ® ™ ♥</p> "
287- }
288- entityHtml += " </body></html> "
289-
290- let iterations = 10
291- var times : [ Double ] = [ ]
292- var timer = PrecisionTimer ( )
293-
294- // Warmup
295- for _ in 0 ..< 3 {
296- _ = try JustHTML ( entityHtml)
297- }
298-
299- // Measure
300- for _ in 0 ..< iterations {
301- timer. begin ( )
302- _ = try JustHTML ( entityHtml)
303- timer. stop ( )
304- times. append ( timer. elapsedMilliseconds)
305- }
306-
307- let avgMs = times. reduce ( 0 , + ) / Double( times. count)
308- let minMs = times. min ( ) ?? 0
309- let maxMs = times. max ( ) ?? 0
310-
311- print ( " \n Entity-heavy HTML: \( entityHtml. count) bytes " )
312- print ( String ( format: " Parse time: %.2f ms avg (min: %.2f ms, max: %.2f ms) " , avgMs, minMs, maxMs) )
313- print ( String ( format: " Throughput: %.2f KB/ms " , Double ( entityHtml. count) / 1024 / avgMs) )
314-
315- // Count entities in sample Wikipedia file (skip if not available)
316- if sampleFilesAvailable ( ) {
317- let wikiHtml = try loadSampleFile ( " wikipedia_ww2.html " )
318- var ampCount = 0
319- for ch in wikiHtml {
320- if ch == " & " { ampCount += 1 }
321- }
322- print ( " \n wikipedia_ww2.html has \( ampCount) potential entity references " )
323- }
324-
325- // Note: No timing assertion - CI machines have variable performance
326- }
327-
328277@Test func profileDictionaryLookup( ) async throws {
329278 print ( " \n " + String( repeating: " = " , count: 70 ) )
330279 print ( " DICTIONARY LOOKUP ANALYSIS " )
0 commit comments