Skip to content

u/Rhinnii

In this archive from Jun 2025 to Oct 2026

8
posts
31
comments
3
media
230
score
4 saved before deletion

Top posts

Laravel's wildcard validation is O(n²), here's a fix

I was profiling a slow import endpoint. 100 items, 47 fields each with exclude_unless and required_if. Endpoint took 3.4 seconds. I assumed database queries. Validation alone was 3.2s. When you write items..name => required|string|max:255, Laravel's explodeWildcardRules() flattens data with Arr::dot...

112 points26 comments
Open on Reddit

Top comments

Unfortunately you get a templated response most of the time. Some of my PRs were closed with the comment that it lacked solid benchmarks. So I made a benchmark application and resubmitted with proper benchmarks, then it got closed without a comment. I would love to get some of these performance boosts into the framework, but I'm afraid it's not happening anytime soon.

46 points

You indeed rarely run into real bottlenecks until you have a bit more complicated data shapes. But it happens quite quickly when you have a couple fields that are array shaped and have a couple fields in each, add some conditional rules and the performance starts getting way too slow to justify

5 points

Subreddits

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.