Enhance detect singletons#231
Conversation
|
Hi @styfenschaer, I finally managed to take a first look - sorry for the delay! Two questions:
I will make some updates to where Also, once again, thanks so much for this! Best, Alex |
|
Btw these speedups are once again pretty amazing: Running case 1
Elapsed [s]: 0.20
Elapsed [s]: 0.05
Speedup: 4.0 (#singletons 0/100000)
Running case 2
Elapsed [s]: 0.48
Elapsed [s]: 0.07
Speedup: 7.0 (#singletons 1/100000)
Running case 3
Elapsed [s]: 1.02
Elapsed [s]: 0.07
Speedup: 15.6 (#singletons 10/100000)
Running case 4
Elapsed [s]: 6.43
Elapsed [s]: 0.08
Speedup: 83.6 (#singletons 100/100000)
Running case 5
Elapsed [s]: 6.43
Elapsed [s]: 0.07
Speedup: 88.4 (#singletons 1000/100000)
Running case 6
Elapsed [s]: 5.91
Elapsed [s]: 0.08
Speedup: 77.1 (#singletons 10000/100000)
Running case 7
Elapsed [s]: 3.10
Elapsed [s]: 0.05
Speedup: 68.9 (#singletons 100000/100000) |
|
Hello @s3alfisc Don't worry, there is no deadline, so there is no delay. These functions are both needed. Sure, I was also wondering if this function should become public, which would mean that the leading underscore should be removed from the name. |
|
Thanks for the explanation Styfen. As you can see, I've already merged the PR, added some simple tests against fixest and put 'detect_singletons' into its own module & also made it public. I hope you'll have a great start into 2024 tonight! |
|
@all-contributors please add @styfenschaer for code |
|
File README.md was not found in the repository (s3alfisc/pyfixest). |
|
@all-contributors please add @styfenschaer for code |
|
I've put up a pull request to add @styfenschaer! 🎉 |
|
@all-contributors please add @styfenschaer for code |
|
@styfenschaer already contributed before to code |
|
@all-contributors please add @NKeleher for code and infra |
|
I've put up a pull request to add @NKeleher! 🎉 |
|
@all-contributors please add @Wenzhi-Ding for code |
|
I've put up a pull request to add @Wenzhi-Ding! 🎉 |
|
@all-contributors please add @apoorvalal for code |
|
I've put up a pull request to add @apoorvalal! 🎉 |
|
@all-contributors please add @styfenschaer for code |
|
@styfenschaer already contributed before to code |
|
@all-contributors please add @juanitorduz for infra, code |
|
This project's configuration file has malformed JSON: .all-contributorsrc. Error:: Unexpected string in JSON at position 400 |
|
@all-contributors please add @juanitorduz for infra, code |
|
I've put up a pull request to add @juanitorduz! 🎉 |
* fix bug and improve performance of _detect_singletons (issue 229) * add test cases for _detect_singletons (issue 229)
This pull request addresses a bug in the
_detect_singletonsfunction and enhances its efficiency (see issue #229). The performance improvement is primarily due to the elimination of array copies, achieved through the use of explicit loops implemented with Numba. The function performs optimally when provided with a column-major order array, which avoids the need for additional copies of the input array. Additionally, this pull request introduces a small test suite to further validate the changes.To facilitate a comparison between the old and new implementations, the following code can be executed. It's important to note that for this comparison, the bug in the old implementation has been corrected.
See comparison