Re: [elixir-core:11706] Performance of regular expression matches

2024-03-15 Thread Jan Krüger
The NIFs might be an explanation, for why this shows up as a larger part of the execution time, than it actually is. I hadn't considered that. It probably makes sense for us to keep the :re.run in any event. I think the motivation for the thread was also just to give a heads up that there

Re: [elixir-core:11704] Performance of regular expression matches

2024-03-15 Thread José Valim
fprof is great at telling what in a given workflow is taking time but comparing fprof results won't tell you by how much it got faster. For that you will have to benchmark it again. For tight-loops though, I can see how removing the version check, option handling and everything else speeds up

Re: [elixir-core:11704] Performance of regular expression matches

2024-03-15 Thread Jan Krüger
Alright. If you can't see it, then it must have been something in my environment. What I did when working on this is run fprof to identify potential performance problems, and the version checked showed up as a substantial part of the time spent in the regex code. Is that a valid use of fprof

Re: [elixir-core:11703] Performance of regular expression matches

2024-03-15 Thread 'marcel...@googlemail.com' via elixir-lang-core
I quickly checked how a persistent term cached implementation would compare, which turned out to perform almost equivalent. It seems the :re.version and :erlang.system_info(:endian) values are already cached. ```elixir defmodule RegexPersistent do def version do case

Re: [elixir-core:11701] Performance of regular expression matches

2024-03-15 Thread José Valim
The 5% also take into account the option processing and result handling. The version check itself is a subset of that. I was not able to measure sensible gains after removing it. On Fri, Mar 15, 2024 at 7:58 AM Manish sharma wrote: > How Machine Learning Services Help Business? >

Re: [elixir-core:11700] Performance of regular expression matches

2024-03-15 Thread Manish sharma
How Machine Learning Services Help Business? - With Machine Learning consulting services businesses can consider cost reduction while boosting performance. - It helps organizations to timely finish the task with utmost accuracy.

Re: [elixir-core:11700] Performance of regular expression matches

2024-03-15 Thread 'marcel...@googlemail.com' via elixir-lang-core
The benchmark results I'm getting are indeed not as dramatic as the fprof results, but on the other hand also more than the 5% mentioned in the PR which introduced the check: https://github.com/elixir-lang/elixir/pull/9040 ```elixir regex = ~r/^([a-z][a-z0-9\+\-\.]*):/i re_pattern =

Re: [elixir-core:11699] Performance of regular expression matches

2024-03-15 Thread Jan Krüger
The difference was definitely measurable just in pure running time of the code, setting aside fprof. I'll post what I have after work today. On Thursday, March 14, 2024 at 10:21:25 PM UTC+1 José Valim wrote: > Do you have benchmarks or only the fprof results? fprof is not a > benchmarking