Another week of exam…
I’ve mainly done two things this week, finishing ID-89 and ID-102.
There is not much to talk about ID-102, just deleting and replacing… For ID-89, refactoring
ldap.js, It’s been a long time that I noticed that operations related with
ldap.js would be much slower than the ordinary. After checking the search operations, I found that the old one will use search which has
ou=users,dc=openmrs,dc=org and a filter of
uid=USERNAME. Then inspired by intuition, I realized that LDAP server may highly possible first fetch all entries under
baseDN and then use that filter to select the items. This would be intolerant in production, as we can directly find the entry via
After performing a little experimentation on my machine and proving that search with direct
DN would be 1 times more faster than with
filter. I rewrote all the operations in the new ldap.js. Hence, this time, the refactor doesn’t only focus on logic flow and readabilities, but also efficiency.
TODO for Next Week
- ES6 investigation
- Something else interesting