در تاریخ دوشنبه ۲۱ سپتامبر ۲۰۲۶، ۱۸:۲۲ David Maye <[email protected]> نوشت:
> Okay there are many things that are incorrect with that benchmark. > > First of all that's not what I intended to say. What I was saying is that > if I use a username function what's the benchmark difference with using a > string mask function from the C extension? And no that's not even what I > said. What I said was using just a mask constant mask wouldn't it be the > same then using a C string because there is no intermittent string > allocation? > > Second in The benchmark that you sent you're using sensitive parameter > attribute. I thought we didn't consider it in the RFC, so why benchmark it? > > Makes no sense. You aren't proving your points that way. > > Kind regards, > > David Maye > --------- Hi David, Fair points, let me clarify: 1. Constant mask: You're right — a hardcoded "#####" needs no allocation. But that only covers static-length data. For real-world input (variable-length emails, phone numbers, card numbers), the mask length must be computed at runtime via str_repeat(), which is exactly where the intermediate allocation happens. str_mask eliminates that step. 2. SensitiveParameter: Good catch. The attribute is pure metadata with zero runtime cost, so it has no effect on the benchmark results. I've removed it from the updated benchmark snippet to keep it consistent with the RFC. Best regards, Sepehr > >
