Moved regex compilation out of the loop in `detectServiceWorker` to a package-level variable. This avoids recompiling the regex for every file and every pattern iteration. Performance improvement: - Speedup: ~5.4x (20.7ms/op -> 3.8ms/op) - Memory: ~94% reduction (13MB/op -> 0.8MB/op) - Allocations: ~89% reduction (80k/op -> 9k/op) |
||
|---|---|---|
| .. | ||
| pwa.go | ||
| pwa_test.go | ||